Let's make known the rules of the game:
Observations:
As you may have seen, the '/' operator has not been taken into account and
has been because the program randomly takes numbers and operators in formulating the expression and using '/' can make the divisions to be performed not complete, with decimal numbers. We didn't want to
complicate the game too much and that's why we found it better to leave it out.
The program is divided into the following parts.
This expression (ERAN$) will be a string of characters for the program. Therefore, the black and white
spaces involved are also significant. Analyze the character string in characters, distinguishing
between themes (numeric strings) and agents (+,–,*) and simultaneously calculating the value
of the expression.
For this distinction it must be taken into account that in the
range of two themes there can be only agents or spaces ahead and behind the agent.
10(1) Getting the number
20 DIM DIG(25):DIM
AUK(8):DIM POSI(8.2):DIM
SIGN(3)
30 CLS:SCREEN 2:KEY
OFF:RANDOMIZE
40=POSI(3) POSI=1AUM=1FN
PRINT "----------------"
280 CIRCLE (100,65),100
290 FOR I=1 TO 8:LOCATE POSI(I,I),POSI(IM,I):PRINT
AUK The statement may be: ";
530 LOCATE 25,20:PRINT "You want to continue (S/N/?"
540 TE$=INKEY$:WHILE TE$ "":TE$=INKEY$:WEND
550 WHILE$ "B" AND TE$ "b" AND TE$ "E" AND TE$ "e":
TE$=INKEY$:WEND
560 IF TE$="B" OR TE$="b"THEN 30
570 LOCATE 23,1:PRINT SPC(79):LOCATE 25,1:PRINT SPC(79):LOCATE 22,30:
PRINT "Goodbye to another! ";
GET NUMBER 580 END
600 REMN AMAIA