![]() |
_indexof2
Make a second version of all the _indexof functions such that they are CaSE seNsItIVE.
|
Hmm. I'm sure it has many uses, but I can't seem to think of any...
|
Well, the base 64 system Stefan created to deal with storing tiles is case sensitive.
|
Quote:
|
Quote:
|
Quote:
|
Quote:
|
Quote:
|
I am positive indexof is a far cry more efficient that a ton of ifs trying to figure out the decimal value of the letter.
|
Quote:
|
Still, far better 1 line as opposed to 64 virtually identical if clauses
I can create a string, call it this.values, and arrange all the characters such that their position in the string is their decimal value. However, for this to work right, indexof needs to differentiate between G and g. Since I don't have access to v3 engine, I can't do a switch statement, which would still be quite a bit longer. So, I am stuck with NPC Code: over and over again |
Quote:
Quote:
|
Would you care to explain how three to four ifs could allow me to convert one of 64 characters into their decimal equivalents?
Secondly, how is it at all inefficient to condense those ifs into a single indexof? |
Quote:
Quote:
|
So, you admit, you just aren't adding three ifs, you are adding other things. And these "ranges" how would you define them?
As for the length of the script, no, I think it is a lot more efficient to say "where is it located?" than several "is it this? No? Well is it that?" indexof may start to be a less efficient piece of code when used 10000 times; but, from what I have seen of differences in efficiency at this level of iteration, I doubt that it's going to be a problem. |
| All times are GMT +2. The time now is 04:53 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.