0 Members and 1 Guest are viewing this topic.
^10 for the one's
:vWHGLVL1"[00]"prgmWHGLVL1"[00]→Str0X
"appvWHGLVL1"[00]"prgmWHGLVL1"[00]->Str0X
Taking the modulus of something finds its remainder after division by a certain number. So 50 mod 6 equals 2 since 50/6 equals 8 remainder 2. If you take something mod 10, you get the last digit (decimal). For example, 85 mod 10 equals 5, and 5 is the digit in the one's place.
"appvWHGLVL00prgmWHGLVL00"->Str0X
So, rather than have one string for each level (using lots of memory), you just have one string that you can change to your needs.Code: [Select]"appvWHGLVL1"[00]"prgmWHGLVL1"[00]->Str0X.L is the level, P is whether or not it's a program. We put its pointer in X.L+48->{P*9+Str0X+7}GetCalc(P*9+Str0X)->XThe line "L+48->{P*9+Str0X+7}" stores the correct digit in the right place. So, if L=6 and P=1, then the data at Str0X now looks like this:Code: [Select]"appvWHGLVL1"[00]"prgmWHGLVL6"[00]The 48 is necessary because the character '0' equals 48, '1' equals 49, etc. 7 is the offset to the first '1', and 9 is the difference between the offsets to the first and second '1's.
"appvWHGLVL1"[00]"prgmWHGLVL1"[00]->Str0X.L is the level, P is whether or not it's a program. We put its pointer in X.L+48->{P*9+Str0X+7}GetCalc(P*9+Str0X)->X
"appvWHGLVL1"[00]"prgmWHGLVL6"[00]
Its easy Just go to options, and select Application under 'shell'. The only difference between apps and programs is you can't modify any data that you create in your program. ie: you cant do this:Code: [Select][000102030405]->Str19->{Str1+5} //cant do that!you have to do this insteadCode: [Select][000102030405]->Str1Copy(Str1,L1,6) //copy it to some free ram, but you cant copy back9->{L1+5}
[000102030405]->Str19->{Str1+5} //cant do that!
[000102030405]->Str1Copy(Str1,L1,6) //copy it to some free ram, but you cant copy back9->{L1+5}
hah well now you know Is it small enough to be a program?