3 ms·
Who says you need graphics? o | o | o ---------- x | x | x ---------- o | o | o That (if HN doesn't mangle it) should be a fully working Tic-Tac-Toe board. Y
by bmelton 16y ago
Who says you need graphics?
o | o | o
----------
x | x | x
----------
o | o | o
That (if HN doesn't mangle it) should be a fully working Tic-Tac-Toe board. You can store it as a string, hashtable, whatever you want. You could label the squares 1-9 for the prompt asking the user where to move.
This is all doable with perl and a command line. Try it out, see what you learn.
- bmelton 16y agoHN mangled it, but I think you can see where the line breaks ought to go.
- spicyj 16y agoo | o | o --------- x | x | x --------- o | o | o
- nkassis 16y agoMy first implementation (in c++) was exactly like that. A 3x3 array that printed out like that. You had to enter 1,1 for the left upper corner (that's how I learned that arrays start at 0 in almost all languages ;p)
- Paulomus 16y agoYes, GNU Go, the premier open source Go program is implemented exactly like this. Any graphical front ends in use are all written by third parties.