Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
35
Task/24-game-Solve/ProDOS/24-game-solve.dos
Normal file
35
Task/24-game-Solve/ProDOS/24-game-solve.dos
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
editvar /modify -random- = <10
|
||||
:a
|
||||
editvar /newvar /withothervar /value=-random- /title=1
|
||||
editvar /newvar /withothervar /value=-random- /title=2
|
||||
editvar /newvar /withothervar /value=-random- /title=3
|
||||
editvar /newvar /withothervar /value=-random- /title=4
|
||||
printline These are your four digits: -1- -2- -3- -4-
|
||||
printline Use an algorithm to make the number 24.
|
||||
editvar /newvar /value=a /userinput=1 /title=Algorithm:
|
||||
do -a-
|
||||
if -a- /hasvalue 24 printline Your algorithm worked! & goto :b (
|
||||
) else printline Your algorithm did not work.
|
||||
editvar /newvar /value=b /userinput=1 /title=Do you want to see how you could have done it?
|
||||
if -b- /hasvalue y goto :c else goto :b
|
||||
:b
|
||||
editvar /newvar /value=c /userinput=1 /title=Do you want to play again?
|
||||
if -c- /hasvalue y goto :a else exitcurrentprogram
|
||||
:c
|
||||
editvar /newvar /value=do -1- + -2- + -3- + -4- /title=c & do -c- >d & if -d- /hasvalue 24 goto :solve
|
||||
editvar /newvar /value=do -1- - -2- + -3- + -4- /title=c & do -c- >d & if -d- /hasvalue 24 goto :solve
|
||||
editvar /newvar /value=do -1- / -2- + -3- + -4- /title=c & do -c- >d & if -d- /hasvalue 24 goto :solve
|
||||
editvar /newvar /value=do -1- * -2- + -3- + -4- /title=c & do -c- >d & if -d- /hasvalue 24 goto :solve
|
||||
editvar /newvar /value=do -1- + -2- - -3- + -4- /title=c & do -c- >d & if -d- /hasvalue 24 goto :solve
|
||||
editvar /newvar /value=do -1- + -2- / -3- + -4- /title=c & do -c- >d & if -d- /hasvalue 24 goto :solve
|
||||
editvar /newvar /value=do -1- + -2- * -3- + -4- /title=c & do -c- >d & if -d- /hasvalue 24 goto :solve
|
||||
editvar /newvar /value=do -1- + -2- + -3- - -4- /title=c & do -c- >d & if -d- /hasvalue 24 goto :solve
|
||||
editvar /newvar /value=do -1- + -2- + -3- / -4- /title=c & do -c- >d & if -d- /hasvalue 24 goto :solve
|
||||
editvar /newvar /value=do -1- + -2- + -3- * -4- /title=c & do -c- >d & if -d- /hasvalue 24 goto :solve
|
||||
editvar /newvar /value=do -1- - -2- - -3- - -4- /title=c & do -c- >d & if -d- /hasvalue 24 goto :solve
|
||||
editvar /newvar /value=do -1- / -2- / -3- / -4- /title=c & do -c- >d & if -d- /hasvalue 24 goto :solve
|
||||
editvar /newvar /value=do -1- * -2- * -3- * -4- /title=c & do -c- >d & if -d- /hasvalue 24 goto :solve
|
||||
:solve
|
||||
printline you could have done it by doing -c-
|
||||
stoptask
|
||||
goto :b
|
||||
Loading…
Add table
Add a link
Reference in a new issue