0 Members and 4 Guests are viewing this topic.
The code from before you edited it, meaning the code with {Str1+I-1}, works correctly.
.ATEST.[00000000000000000000000000000000]→Str1Zeros(32)→Str1.Zeros() does the same thing, but it's easier to code in in this case :P.worked with initial bunch of 00s as well"0123456789-+/*^,()"→Str0For(I,0,15){rand^18+Str0}→{Str1+I}.counting from zero is usually more efficient, in this case the -1 is omittedEndClrHomeDisp Str1Repeat getKey(15).wait until clear is pressedPause 10End
The reason I edited to {Str1 + 2I - 2} was because each byte in the string with 16 letters represents a letter. So if I=1, position in the string (p) is 0; I=2, p=2, I=3, p=4 and so on. 2I-2 is the order of the 'th' in the string as 'I' increases. I tried to put Pause 1900 at the end of the code and ran the program, the program paused for a while but still doesn't display anything.
Input is really buggy, personally I'd only use it as a last resort. You'd probably be better off making your own input routine (or use one from the routines thread, such as this from the routines thread)
.GUESS"GUESS THE NUMBERüStr1"TOO HIGH!üStr1H"TOO LOW!üStr1L"YOU WIN!üStr1WDiagnosticOffLbl MNClrHomeDisp Str1rand→BWhile B-9→B>9:EndLbl Msub(1)If K=15ClrHomeReturnEndIf A>BDisp Str1H,iGoto MEndIf A<BDisp Str1L,iGoto MEndDisp Str1W,iPause 2000ClrHomeReturnLbl 10→AgetKey→KIf K=36:7→AEndIf K=35:4→AEndIf K=34:1→AEndIf K=28:8→AEndIf K=27:5→AEndIf K=26:2→AEndIf K=20:9→AEndIf K=19:6→AEndIf K=18:3→AEndReturnIf K=15ReturnIf A not equal to 0Goto 1
The "While B-9→B>9:End" limits the number to 0-9.