Tic-tac-toe: Difference between revisions

Content deleted Content added
Roryokane (talk | contribs)
→‎{{header|Ruby}}: improve AI’s defense; refactor a lot; make more idiomatic; make board printout look nicer
Roryokane (talk | contribs)
m →‎{{header|Haskell}}: fix English error (misspelling of “last resort”) in comment
Line 2,032: Line 2,032:
-- and tries to block.
-- and tries to block.
-- otherwise, it tries to guess the best position for the next movement.
-- otherwise, it tries to guess the best position for the next movement.
-- as a least ressource, it places a piece randomly.
-- as a last resort, it places a piece randomly.
autoTurn :: Bool -> (Int, Char, String) -> IO (Int, Char, String)
autoTurn :: Bool -> (Int, Char, String) -> IO (Int, Char, String)
autoTurn forceRandom (count, player, game) = do
autoTurn forceRandom (count, player, game) = do