Data update
This commit is contained in:
parent
0df55f9f24
commit
aec8ed51b6
1045 changed files with 18889 additions and 2777 deletions
15
Task/Nim-game/Chipmunk-Basic/nim-game.basic
Normal file
15
Task/Nim-game/Chipmunk-Basic/nim-game.basic
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
100 cls
|
||||
110 monton = 12
|
||||
120 llevar = 0
|
||||
130 do while monton > 0
|
||||
140 print using "There are ## tokens remaining. How many would you like to take";monton;
|
||||
150 input llevar
|
||||
160 do while llevar = 0 or llevar > 3
|
||||
170 input "You must take 1, 2, or 3 tokens. How many would you like to take";llevar
|
||||
180 loop
|
||||
190 print "On my turn I will take";4-llevar;" token(s)."
|
||||
200 monton = monton-4
|
||||
210 loop
|
||||
220 print
|
||||
230 print "I got the last token. I win! Better luck next time."
|
||||
240 end
|
||||
15
Task/Nim-game/MSX-Basic/nim-game.basic
Normal file
15
Task/Nim-game/MSX-Basic/nim-game.basic
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
100 CLS : rem 100 HOME for Applesoft BASIC
|
||||
110 LET M = 12
|
||||
120 LET L = 0
|
||||
130 IF M <= 0 THEN GOTO 220
|
||||
140 PRINT "There are "; M; " tokens remaining. How many would you like to take";
|
||||
150 INPUT L
|
||||
160 IF L <> 0 AND L <= 3 THEN GOTO 190
|
||||
170 PRINT "You must take 1, 2, or 3 tokens. How many would you like to take";
|
||||
180 GOTO 150
|
||||
190 PRINT "On my turn I will take "; 4 - L; " token(s)."
|
||||
200 LET M = M - 4
|
||||
210 GOTO 130
|
||||
220 PRINT
|
||||
230 PRINT "I got the last token. I win! Better luck next time."
|
||||
240 END
|
||||
22
Task/Nim-game/Minimal-BASIC/nim-game.basic
Normal file
22
Task/Nim-game/Minimal-BASIC/nim-game.basic
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
10 LET H = 12
|
||||
20 PRINT "There are"
|
||||
30 PRINT H
|
||||
40 PRINT "tokens remaining. How many would you like to take?"
|
||||
50 INPUT T
|
||||
60 IF T > 3 THEN 170
|
||||
70 IF T < 1 THEN 170
|
||||
80 LET H = H - T
|
||||
90 IF H = 0 THEN 190
|
||||
100 LET T = 4 - T
|
||||
110 PRINT "I will take"
|
||||
120 PRINT T
|
||||
130 PRINT "tokens."
|
||||
140 LET H = H - T
|
||||
150 IF H = 0 THEN 210
|
||||
160 GOTO 20
|
||||
170 PRINT "You must take 1, 2, or 3 tokens."
|
||||
180 GOTO 50
|
||||
190 PRINT "Congratulations. You got the last token."
|
||||
200 GOTO 220
|
||||
210 PRINT "I got the last token. I win. Better luck next time."
|
||||
220 END
|
||||
22
Task/Nim-game/Quite-BASIC/nim-game.basic
Normal file
22
Task/Nim-game/Quite-BASIC/nim-game.basic
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
10 LET H = 12
|
||||
20 PRINT "There are"
|
||||
30 PRINT H
|
||||
40 PRINT "tokens remaining. How many would you like to take?"
|
||||
50 INPUT ""; T
|
||||
60 IF T > 3 THEN 170
|
||||
70 IF T < 1 THEN 170
|
||||
80 LET H = H - T
|
||||
90 IF H = 0 THEN 190
|
||||
100 LET T = 4 - T
|
||||
110 PRINT "I will take"
|
||||
120 PRINT T
|
||||
130 PRINT "tokens."
|
||||
140 LET H = H - T
|
||||
150 IF H = 0 THEN 210
|
||||
160 GOTO 20
|
||||
170 PRINT "You must take 1, 2, or 3 tokens."
|
||||
180 GOTO 50
|
||||
190 PRINT "Congratulations. You got the last token."
|
||||
200 GOTO 220
|
||||
210 PRINT "I got the last token. I win. Better luck next time."
|
||||
220 END
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
5 cls
|
||||
10 print "NIM"
|
||||
20 let h = 12
|
||||
30 print "There are ", h ," tokens remaining."
|
||||
40 input "How many would you like to take? ", t
|
||||
50 if t > 3 then 140
|
||||
60 if t < 1 then 140
|
||||
70 let h = h - t
|
||||
80 if h = 0 then 160
|
||||
90 let t = 4 - t
|
||||
100 print "I will take ", t ," tokens."
|
||||
110 let h = h - t
|
||||
120 if h = 0 then 180
|
||||
130 goto 30
|
||||
140 print "You must take between 1 to 3 tokens."
|
||||
150 goto 40
|
||||
160 print "Congratulations. You got the last token."
|
||||
170 goto 190
|
||||
180 print "I got the last token. I win. Better luck next time."
|
||||
190 shell "pause"
|
||||
Loading…
Add table
Add a link
Reference in a new issue