Talk:Tic-tac-toe

From Rosetta Code

lang tag and line width

I notice that the lang tag is setting a severe maximum line width before scrolling. I would suggest it not be done or be set to something large e.g. 160 characters. --Paddy3118 07:15, 4 February 2011 (UTC)

It's never been a problem for me; is this in fact due to the box containing the code being constrained in width by the result of the {{task}} template? If so, the problem will go away (or at least become purely characterized by the width of the browser window, as is good and proper) once there are some more implementations. –Donal Fellows 10:04, 4 February 2011 (UTC)
Oh. Looking at it from work, things seem to be fixed. Thanks?! --Paddy3118 10:51, 4 February 2011 (UTC)

Design issues

A few notes on the Tcl solution that are perhaps of more general interest.

I decided to keep the game core separate from the players. Although this makes the code quite a bit longer, it also makes it clearer what the responsibilities are and how much knowledge they can have (they know their letter, they can see the board and the legal moves on it) and so it properly demonstrates that it is a game. Well, in my opinion anyway. –Donal Fellows 09:33, 5 February 2011 (UTC)

... And I like your printout of the board. I really did do a minimal version of the game for Python. Maybe someone else will do a fancy version in Python for comparison? --Paddy3118 12:45, 5 February 2011 (UTC)

letting the human win (sometimes)

A note on the REXX solution:   tic-tac-toe games,   if played perfectly,   will always end in a draw.

Since kids may be playing it   (or adults with very short attention spans),   I programmed a "hole" in the logic of the REXX program   so that if a human player plays first (the default),   they may win if a certain pair of moves are made.   -- Gerard Schildberger 23:49, 10 December 2012 (UTC)

"ancient" computer game

I'm surprised that   BASIC,   FORTRAN,   and   PL/I   computer programming languages haven't had solutions entered   (at the time of this posting).   Tic-tac-toe was one of the first games written in any language as it was so simple to program and display.   I still have my FORTRAN and PL/I programs laying around from the mid 1960s which played on a   NxN   grid.   Now, if I could only find a card reader ... -- Gerard Schildberger 19:10, 23 April 2012 (UTC)

3D tic-tax-toe

Has anyone thought of writing/entering a   3D   version of tic-tac-toe for Rosetta Code   (as a separate task, of course)?

I imagine the programs would get a tad obtuse   (hard to follow).   -- Gerard Schildberger (talk) 00:58, 17 April 2016 (UTC)




I wrote a PL/I program   (the default grid size was 4x4x4)   and it was (an infamous) favorite with the (IBM) OS/MFT operators.   No terminals with screens back then for our shop   ---   that was waaaaaaaay back in   (cough-cough)   1970,   ... just the mainframe console   (an IBM 1052 typewriter).   A lot of time was wasted on the off-shifts and weekends, to be sure.   A lot of operators volunteered to work on weekends, and the   powers-that-be   never caught on   (or just didn't care). -- Gerard Schildberger (talk) 00:58, 17 April 2016 (UTC)


The PL/I program had a   4D   capability,   that is,   after so many moves were done   (this could be specified at game start),   the oldest marker was   removed   from the playing grid.   -- Gerard Schildberger (talk) 00:58, 17 April 2016 (UTC)