Tic-tac-toe
This commit is contained in:
parent
ebd245352b
commit
67ee613100
@ -21,6 +21,15 @@ read usr
|
||||
ttt[$usr-1]="O"
|
||||
|
||||
# bash puts cross
|
||||
.........
|
||||
n=1
|
||||
while [ 1 -eq $n ]
|
||||
do
|
||||
l=$(($RANDOM % 9))
|
||||
if [ ${ttt[$l]} = "_" ]
|
||||
then
|
||||
ttt[$l]="X"
|
||||
n=0
|
||||
fi
|
||||
done
|
||||
|
||||
done
|
||||
|
Loading…
Reference in New Issue
Block a user