nu(a) = 4
NEXT a
-' Draw the initial checkerboard pattern
+' Draw the initial checkerboard pattern.
+' (alternating squares to create the checkerboard)
+
FOR a = 2 TO 10 STEP 2
FOR b = 1 TO 10 STEP 2
PAINT ((b * 40) + 5, (a * 18) + 5)
mang
SUB asend
+ ' Draw the pieces on the board
FOR b = 1 TO 10
FOR a = 1 TO 10
v = nu(((b - 1) * 20) + a)
END SUB
SUB look
+ ' checks if there are any possible moves on the board
looma = 0
FOR a = 1 TO 200
IF nu(a) = 0 AND nu(a - 21) = 1 AND nu(a - 42) = 3 THEN looma = 1
SUB motleb
3
-REM T O P E L T L O O K
+' Check for possible jumps (double eating)
FOR a = 1 TO 200
IF nu(a) = 1 AND nu(a + 21) = 0 AND nu(a + 42) = 3 AND nu(a + 61) = 0 AND nu(a + 80) = 3 THEN nu(a) = 3: nu(a + 21) = 3: nu(a + 42) = 1: kaik = 1: asend: GOTO 3
IF nu(a) = 1 AND nu(a + 21) = 0 AND nu(a + 42) = 3 AND nu(a + 23) = 0 AND nu(a + 4) = 3 THEN nu(a) = 3: nu(a + 21) = 3: nu(a + 42) = 1: kaik = 1: asend: GOTO 3
IF nu(a) = 1 AND nu(a - 19) = 0 AND nu(a - 38) = 3 AND nu(a - 57) = 0 AND nu(a - 76) = 3 THEN nu(a) = 3: nu(a - 19) = 3: nu(a - 38) = 1: aiki = 1: asend: GOTO 3
NEXT a
-REM L I H T S A L T L O O K
+' Check for possible single moves (single eating)
FOR a = 1 TO 200
IF nu(a) = 1 AND nu(a + 21) = 0 AND nu(a + 42) = 3 THEN nu(a) = 3: nu(a + 21) = 3: nu(a + 42) = 1: GOTO 2
IF nu(a) = 1 AND nu(a + 19) = 0 AND nu(a + 38) = 3 THEN nu(a) = 3: nu(a + 19) = 3: nu(a + 38) = 1: GOTO 2
IF nu(a) = 1 AND nu(a - 21) = 0 AND nu(a - 42) = 3 THEN nu(a) = 3: nu(a - 21) = 3: nu(a - 42) = 1: GOTO 2
IF nu(a) = 1 AND nu(a - 19) = 0 AND nu(a - 38) = 3 THEN nu(a) = 3: nu(a - 19) = 3: nu(a - 38) = 1: GOTO 2
NEXT a
-REM K A I T S E B
+
+' Check for possible captures (to protect your pieces)
FOR a = 1 TO 200
IF nu(a) = 1 AND nu(a + 19) = 3 AND nu(a + 21) = 3 AND nu(a + 40) = 1 AND nu(a + 38) = 3 AND nu(a + 61) = 0 THEN nu(a) = 3: nu(a + 19) = 1: GOTO 2
IF nu(a) = 1 AND nu(a + 19) = 3 AND nu(a + 21) = 0 AND nu(a + 40) = 1 AND nu(a + 38) = 3 AND nu(a + 61) = 0 THEN nu(a) = 3: nu(a + 19) = 1: GOTO 2
IF nu(a - 2) = 1 AND nu(a + 19) = 3 AND nu(a) = 3 AND nu(a + 40) = 1 AND nu(a + 38) = 1 AND nu(a + 61) = 0 THEN nu(a - 2) = 3: nu(a + 19) = 1: GOTO 2
IF nu(a - 2) = 1 AND nu(a + 19) = 3 AND nu(a) = 1 AND nu(a + 40) = 1 AND nu(a + 38) = 1 AND nu(a + 61) = 0 THEN nu(a - 2) = 3: nu(a + 19) = 1: GOTO 2
NEXT a
-REM L A H E B N U R K A
+
+' Check for possible moves to the edge
FOR a = 1 TO 200
IF nu(a) = 1 AND nu(a + 2) = 4 AND nu(a + 21) = 3 THEN nu(a) = 3: nu(a + 21) = 1: GOTO 2
IF nu(a) = 1 AND nu(a - 2) = 4 AND nu(a + 19) = 3 THEN nu(a) = 3: nu(a + 19) = 1: GOTO 2
NEXT a
-REM O H U T U K A I K
+
+' Check for possible moves to the corner (safe moves)
FOR a = 1 TO 200
IF nu(a) = 1 AND nu(a + 19) = 3 AND nu(a + 38) = 3 AND nu(a + 40) = 3 THEN nu(a) = 3: nu(a + 19) = 1: GOTO 2
IF nu(a) = 1 AND nu(a + 21) = 3 AND nu(a + 42) = 3 AND nu(a + 40) = 3 THEN nu(a) = 3: nu(a + 21) = 1: GOTO 2
IF nu(a) = 1 AND nu(a + 19) = 3 AND nu(a + 38) = 1 AND nu(a + 40) = 1 THEN nu(a) = 3: nu(a + 19) = 1: GOTO 2
IF nu(a) = 1 AND nu(a + 21) = 3 AND nu(a + 42) = 1 AND nu(a + 40) = 1 THEN nu(a) = 3: nu(a + 21) = 1: GOTO 2
NEXT a
-REM M O T T E T U K A I K
+
+' Check for possible moves to the middle (useless moves)
FOR a = 1 TO 200
IF nu(a) = 1 AND nu(a + 21) = 3 THEN nu(a) = 3: nu(a + 21) = 1: GOTO 2
IF nu(a) = 1 AND nu(a + 19) = 3 THEN nu(a) = 3: nu(a + 19) = 1: GOTO 2
PRINT a1; "-"; a2
10
- ' K O N T R O L L
+
+ ' This section controls the movement of pieces on the board
IF a1 = a2 + 19 AND nu(a1) = 0 AND nu(a2) = 3 THEN
BEEP
SWAP nu(a1), nu(a2)