0 Members and 6 Guests are viewing this topic.
I never heard of tokenized sprite before
Great idea! I assume you mean strings would look like this: "Part 1"+?41+"Next Part"+Str1 If Str1 was "Hi" then it would result as "Part 1ANext PartHi". Sounds cool.
The next version has already taken care of getting 'illegal' characters into strings using standard tokens.Let me just explain signed vs unsigned so it doesn't confuse anyone. All the numbers are unsigned meaning they represent a number between 0 and 65535. Negative numbers act just like the regular numbers counted backwards instead of forwards, that is -1 is really 65535, -2 is really 65534, etc. This allows normal subtraction and addition with negative numbers that everyone is used to.That's all well and good until you have a statement like -1<1. That would actually be false since 65535 is not less than 1. You can get around this by doing a 'signed comparison' which is what calc84maniac is talking about. The limitations with signed comparison is that your numbers can only be half the size, that is -32768 to 32767. So you would not be able to use the signed comparison (and get the correct answer) if the number is too large or too small.This is an good idea to implement, but I think I would want it more intuitive than a question mark. Maybe something like -1<<1 would be better? Repeating any operation twice will do the signed version of the operation. So -4<<2 equals 1 and -2**8 would equal -16.Oh and by the way, bitwise and Boolean or are identical, there is no reason to separate the 2.
But now that I think about it, maybe I should make the regular "or" "and" "xor" the Boolean versions (like basic) and then add new commands for the bitwise operations. I'm thinking to use the plot symbols for this. The little dot will be "and", the little plus sign will be "or" and the little square will be "xor".