'Othello by Lionel Baboud 'casio site:http://perso.wanadoo.fr/duobab/ 'e-mail:roland.baboud@wanadoo.fr '----------- Characters translation : ------------------------ | >= : greater or equal | <= : less or equal | <> : not equal | -> : the single arrow | => : the double arrow 2 -> E~F {-1,-1,-1,0,1,1,1,0} -> List 2 {-1,0,1,1,1,0,-1,-1} -> List 3 {0,0,0,0,0,0,0,0} -> List 1 Identity 10 -> Mat A Fill(0,Mat A -1 -> Mat A[5,5] -1 -> Mat A[6,6] 1 -> Mat A[5,6] 1 -> Mat A[6,5] AxesOff ViewWindow -8.8,9.2,1,0.2,9,1 Text 3,20,"OTHELLO" For 0 -> A To 0.95 Step 0.14 F-Line -6,2.3-A,-2.4,2.3-A F-Line -7.4,1.2-A,-0.8,1.2-A Next Orange Text 49,22,"BABOUD" Orange Text 57,12,"PRODUCTIONS" For 1 -> A To 9 F-Line 1,A,9,A F-Line A,1,A,9 Next For 4 -> A To 5 For 4 -> B To 5 For B+0.3 -> Z To B+0.8 Step 0.15 If Mat A[B+1,A+1]=-1 Then Green F-Line A+0.3,Z,A+0.8,Z Else Orange F-Line A+0.3,Z,A+0.8,Z IfEnd Next Next:Next 1 -> G~N F-Line N+0.5,0.3,N+0.5,0.8 F-Line 0.3,M+0.5,0.8,M+0.5 1 -> P Green Text 20,15,"PLAYER 1:" Orange Text 30,15,"PLAYER 2:" 0 -> L Lbl 1 Text 20,8," " Text 30,8," " Text 20,55,E Text 30,55,F Text 25-5P,8," -> " Do If G <> (58-7M) Then Text G,65," " F-Line 0.3,M+0.5,0.8,M+0.5 Else Text 58,H," " F-Line N+0.5,0.3,N+0.5,0.8 IfEnd Do:Getkey -> K LpWhile K=0 58-7M -> G:7N+65 -> H K=27 => N<8 => N+1 -> N K=28 => M<8 => M+1 -> M K=37 => M>1 => M-1 -> M K=38 => N>1 => N-1 -> N LpWhile K <> 31 And K <> 79 If K=31 And Mat A[M+1,N+1]=0 Then 0 -> O Text 57,3,"#" F-Line 2,2,2,3 For 1 -> A To 8 0 -> Z List 2[A] -> U List 3[A] -> V While Mat A[M+1+U(Z+1),N+1+V(Z+1)]=P Z+1 -> Z WhileEnd Mat A[M+1+U(Z+1),N+1+V(Z+1)] <> ‡P => 0 -> Z Z -> List 1[A] Z <> 0 => 1 -> O Next If O=1 Then -P -> P 0 -> L 0 -> D For M+0.3 -> A To M+0.8 Step 0.15 P=-1 => Green F-Line N+0.3,A,N+0.8,A P=1 => Orange F-Line N+0.3,A,N+0.8,A Next P -> Mat A[M+1,N+1] For 1 -> T To 8 List 1[T] -> Z List 2[T] -> A List 3[T] -> B If Z <> 0 Then M -> U:N -> V For 1 -> W To Z D+1 -> D U+A -> U:V+B -> V P -> Mat A[U+1,V+1] Orange Text 58-7U,7V+65," " For U+0.3 -> C To U+0.8 Step 0.15 P=-1 => Green F-Line V+0.3,C,V+0.8,C P=1 => Orange F-Line V+0.3,C,V+0.8,C Next Next IfEnd Next If P=-1 Then D+E+1 -> E:F-D -> F Else D+F+1 -> F:E-D -> E IfEnd IfEnd Text 57,3," " IfEnd If K=79 Then -P -> P L+1 -> L IfEnd L <> 2 And (E+F) <> 64 => Goto 1 ClrText E>F => "THE PLAYER 1 WINS!" F>E => "THE PLAYER 2 MINS!" E=F => "DRAW GAME!"