June 2021
Beginner
432 pages
9h 9m
English
In this classic tile-dropping board game for two players, you must try to get four of your tiles in a row horizontally, vertically, or diagonally, while preventing your opponent from doing the same. This program is similar to Connect Four.
When you run fourinarow.py, the output will look like this:
Four in a Row, by Al Sweigart al@inventwithpython.com
--snip--
1234567
+-------+
|.......|
|.......|
|.......|
|.......|
|.......|
|.......|
+-------+
Player X, enter a column or QUIT:
> 3 1234567 +-------+ |.......| |.......| |.......| |.......| |.......| |..X....| +-------+ Player O, enter a column or ...Read now
Unlock full access