Tic-tac-toe: Difference between revisions
→{{header|EasyLang}}
Line 2,836:
[https://easylang.online/apps/tictactoe.html Run it]
<syntaxhighlight lang="text">
len f[] 9
state = 0
textsize 14
Line 2,853 ⟶ 2,854:
line 86 56
linewidth 2.5
for i
f[i] = 0
.
Line 2,861 ⟶ 2,862:
.
func draw ind . .
c = (ind - 1) mod 3
r = (ind - 1) div 3
x = c * 28 + 20
y = r * 28 + 14
Line 2,880 ⟶ 2,881:
.
func sum3 a d . st .
for i
s += f[a]
a += d
Line 2,892 ⟶ 2,893:
func rate . res done .
res = 0
for i
call sum3 i
.
for i
call sum3 i 3 res
.
call sum3
call sum3
cnt = 1
for i
if f[i] = 0
cnt += 1
Line 2,933 ⟶ 2,934:
.
.
mov =
until mov = start or rval >= beta
.
Line 2,962 ⟶ 2,963:
.
func human . .
mov = floor ((mouse_x - 6) / 28) + 3 * floor (mouse_y / 28) + 1
if f[mov] = 0
f[mov] = 1
Line 2,988 ⟶ 2,989:
.
.
call init
</syntaxhighlight>
=={{header|Erlang}}==
|