Send ttt.ps
to your printer:
cat ttt.ps - | nc 192.168.2.10 9100
Or use GhostScript:
gs -DNOSAFER -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -sOutputFile="%d.pdf" ttt.ps
Play by entering numbers from 1 to 9.
The code will produce console + print output.
Both files are equivalent.
ttt_full.ps
is the readable version.
ttt.ps
is the minified version.
Printer applies the following rules.
Dead simple and keeps the fun.
- printer attempts to block human
- printer attempts to win
- printer plays randomly
OX.
.X.
XO.
human turn (1-9) >9
OX.
.X.
XOO
OXX
.X.
XOO
PRINTER WINS