0 Members and 1 Guest are viewing this topic.
1. How can you make it that a variable toggles from 0 to 1 and vice versa if you press a special key, but it doesn't keep toggling when you hold it?It shouldn't influence the other getkeys for movement, etc. in the same loop.
0→DRepeat getKey(15)getKey(9)→C!If C0→DEndIf C+D=11→DEnd....End
0→DRepeat getKey(15)getKey(9)→CC*D+C and 1→D....End
0→DRepeat getKey(15)getKey(9)→CC and D or C and 1→D....End
0->DRepeat getkey(15)If getkey(9) If D 0->D Else 1->D End End...End
0➔D+1➔E .this stores 0 to D and 1 to ERepeat getKey(15) If getKey(9) and E D xor 1➔D .this toggles D 0➔E Else 1➔E End...End
Repeat getKey(15) getKey➔C If C=9 D xor 1➔D EndEnd
2. Is it possible to display two buffers on top of each other (or / xor) without having greyscale?
For(Y,0,63)For(X,0,95)If pxl-test(X,Y)^rPxl-On(X,Y) // Pxl-On for or, Pxl-Change for xorEndEndEnd
For(A,L₃,L₃+767) {A} or {A−L₃+L₆}➔{A}End
3. Is there a short way of letting to user chose from a bunch of saved files (appvars) to reload or chose the file to save the data, without having that many If-statements?
Code: [Select]For(A,L?,L?+767) {A} or {A?L?+L?}?{A}EndThis is much faster!Edit: even faster!
For(A,L?,L?+767) {A} or {A?L?+L?}?{A}End
[...] I calculated that the following loop runs about 40 times per second at 6MHz:Code: [Select]Repeat getKey(15)For(A,0,383).That ﹢ symbol is the 16-bit OR operator{A*2+L₆}ʳ﹢{A*2+L₃}ʳ→{A*2+L₆}ʳEndC+1→CEnd
Repeat getKey(15)For(A,0,383).That ﹢ symbol is the 16-bit OR operator{A*2+L₆}ʳ﹢{A*2+L₃}ʳ→{A*2+L₆}ʳEndC+1→CEnd
Quote from: MGOS on October 30, 2011, 07:28:39 am3. Is there a short way of letting to user chose from a bunch of saved files (appvars) to reload or chose the file to save the data, without having that many If-statements?You have two options - you can either use Memkit to get the names of all the appvars in memory, and then display them as a scrolling list, and have the user choose between them, or you can use or write a custom input function, like the one in Firefall, that one's pretty good.
L₆For(383) {➔A}ʳ﹢{A+L₃-L₆}ʳ➔{A}ʳ+1End
1. jacobly's solution is what I would do too.
2. You can do it even faster with the new speed loop: Code: [Select]L₆For(383) {➔A}ʳ﹢{A+L₃-L₆}ʳ➔{A}ʳ+2End
L₆For(383) {➔A}ʳ﹢{A+L₃-L₆}ʳ➔{A}ʳ+2End
3. If your saved data takes a standard form like "appvSAVE1", "appvSAVE2", "appvSAVE3", etc. Then you can construct the first part of the string in some memory by doing copy("appvSAVE0",L1,7) and then make the string the Nth file by doing N+'0'➔{L1+5}. Now all you have to do to load the file is just GetCalc(L1) which uses the string you just constructed. If you want to list all the appvars on the calculator that start with your custom header and choose from those, you'll have to use memkit.