I have read the page on Custom input, but it didn't say much about an advanced number input. I have attempted to make this but to no avail. I used the abs( and it gets hung up on Enter and Del. I was wondering if there is just a custom number input that can be displayed on the graph screen. If someone could help me figure this out, I would be very happy. :D This is for my new poker game :o
what do you mean by advanced? You could always use Input ;)
EDIT: (Also the link posted has some really good examples that are better than mine!)
A number input in itself wouldn't be that much different from a text input.
This code would take a key input and give you the corresponding number.
getKey>K "789*456*123*0.-*">Str1 K/10-7.1>K "*">Str2 if(K>7 and fPart(K)!=.1):Then 10fPart(K)+4iPart(K)>B sub(Str1,B,1)>Str2 End
I think that will work. If you get a * it means the user pressed an invalid key
Then after you ket the string, use expr( to change it into a number.
Have it in a look that only terminates when K=105
if K=23, decrement the string by 1.
Hope this helps!
Thanks, sorry for replying late.
I do get a domain error on this line.
if(K>7 and fPart(K)!=.1):Then
The cursor goes to the !
Is that a factorial symbol?
oh, well it should be
getKey>K "789*456*123*0.-*">Str1 K/10-7.1>K "*">Str2 if(K>7 and fPart(K)≠.1):Then 10fPart(K)+4iPart(K)>B sub(Str1,B,1)>Str2 End
This doesn't seem to work. I added a text display, but it didn't show anything. When I checked the strings, they were unchanged.
I also added a Repeat K=105 line to the front and End to the back side.
Why, oh why, do people post broken, untested code?
See if this fits your needs. Delete is supported, and it won't let the user submit until a number has been typed:
Repeat 41=abs(K-64) and 1≠length(Str1
If Ans=102 or 2>abs(5-abs(5-abs(Ans-83
Ahhhh I got it!!
Had to add a repeat at start to check when enter is pressed.
I already did that for you. The number 105 is implicitly found in the conditions of both loops: 41=abs(K-64) sees if K equals 105 or 23, and then K can only be one of those two values when it hits the outermost repeat, so the K≠23, being smaller than K=105, is used instead. Write the code as it is given above; it works just fine.
Oh no! I have been programing in java for too long! :D