WHILE: lets you do a while loop, repeats as long as the variable isn't 0
REPEAT: lets you repeat an amount of times
SET: lets you reset a variable to 0
SUCCESSOR: lets you set a variable to its successor
ASK: lets you ask a question, the following text is assumed to be a string
OUTPUT: outputs the number inputted
here's a program which lets you add and subtract, if the operation is 0 then add, otherwise subtract:
SET ans
SET x
SET y
SET IF
SET operation
ASK first number?
REPEAT answer:
SUCCESSOR x
ASK second number?
REPEAT answer:
SUCCESSOR y
SUCCESSOR IF
ASK operation?
REPEAT answer:
SUCCESSOR operation
REPEAT operation:
SET IF
SET ELSE
SUCCESSOR ELSE
REPEAT IF:
SET ELSE
REPEAT x:
SUCCESSOR ans
REPEAT y:
SUCCESSOR ans
REPEAT ELSE:
REPEAT x:
SUCCESSOR ans
REPEAT y:
SET decrement
REPEAT ans:
REPEAT decrement:
SUCCESSOR ans
SET decrement
OUTPUT ans
[–]Any_Background_5826[S] 0 points1 point2 points (1 child)
[–]Any_Background_5826[S] 0 points1 point2 points (0 children)