Talk:Tic-tac-toe: Difference between revisions

m
m (→‎ancient computer game: added tongue-in-check quotation marks to talk section name.)
 
(18 intermediate revisions by the same user not shown)
Line 13:
... 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? --[[User:Paddy3118|Paddy3118]] 12:45, 5 February 2011 (UTC)
 
: I took that approach and added still more whitespace (for the REXX entry). &nbsp; To make the game board (grid) easier to see (without the reference numbers --- otherwise it gets cluttered/obfuscated pretty fast with any game board larger than nine cells) &nbsp; --- I removed the &nbsp; ''numbering'' &nbsp; grid and placed it to the right of the playing board (along with generous whitespace. &nbsp; --- this causes a reference game board (grid) to be displayed, making it a lot easier on the ole eyeballs to see who has what markers where, and what's available for a move (empty cell), and in specifying where to <strike>move</strike> place a piece/marker. &nbsp; -- [[User:Gerard Schildberger|Gerard Schildberger]] ([[User talk:Gerard Schildberger|talk]]) 16:18, 3 October 2017 (UTC)
A note on the REXX solution: the tic-tac-toe game, 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 so that if a human player plays first (the default), they may win if a certain pair of moves are made. -- [[User:Gerard Schildberger|Gerard Schildberger]] 23:49, 10 December 2012 (UTC)
 
 
: An illuminating example &nbsp; (from a &nbsp; '''4'''&times;'''4''' &nbsp; tic─tac─toe game in progress):
<pre>
───────── computer places a marker [O] at cell number 16
 
║ ║ ║ │ │ │
║ ║ ║ 1 │ 2 │ 3 │ 4
║ ║ ║ │ │ │
═════╬═════╬═════╬═════ ─────┼─────┼─────┼─────
║ ║ ║ │ │ │
║ X ║ ║ X 5 │ 6 │ 7 │ 8
║ ║ ║ │ │ │
═════╬═════╬═════╬═════ ─────┼─────┼─────┼─────
║ ║ ║ │ │ │
║ O ║ ║ 9 │ 10 │ 11 │ 12
║ ║ ║ │ │ │
═════╬═════╬═════╬═════ ─────┼─────┼─────┼─────
║ ║ ║ │ │ │
║ ║ ║ O 13 │ 14 │ 15 │ 16
║ ║ ║ │ │ │
 
───────── Please enter a cell number to place your next marker [X] (or Quit):
</pre>
 
== letting the human win (sometimes) ==
A note on the REXX solution: &nbsp; tic-tac-toe games, &nbsp; if played perfectly, &nbsp; will always end in a draw, making it a &nbsp; [https://en.wikipedia.org/wiki/Futile_game futile game].
<br>(For the case for a &nbsp; '''2x2''' &nbsp; grid, a win is guaranteed for the player moving first.)
 
A note on the REXX solution: the tic-tac-toe game, if played perfectly, will always end in a draw. Since kids may be playing it &nbsp; (or adults with very short attention spans), &nbsp; I programmed a "hole" in the logic of the REXX program &nbsp; so that if a human player plays first (the default), &nbsp; they may win if a certain pair of moves are made. &nbsp; -- [[User:Gerard Schildberger|Gerard Schildberger]] 23:49, 10 December 2012 (UTC)
 
It's not much fun playing a game ya can't win. &nbsp; -- [[User:Gerard Schildberger|Gerard Schildberger]] ([[User talk:Gerard Schildberger|talk]]) 15:52, 3 October 2017 (UTC)
 
=="ancient" computer game==
 
I'm surprised that &nbsp; BASIC, &nbsp; FORTRAN, &nbsp; and &nbsp; PL/I &nbsp; computer programming languages haven't had solutions entered &nbsp; (at the time of this posting). &nbsp; Tic-tac-toe was one of the first games written in any language as it was so simple to program and display. &nbsp; I still have my FORTRAN and PL/I programs laying around from the mid 1960s. which played on a &nbsp; NxN &nbsp; grid. &nbsp; Now, if I could only find a card reader ... -- [[User:Gerard Schildberger|Gerard Schildberger]] 19:10, 23 April 2012 (UTC)
 
== 3D tic-tac-toe ==
 
Has anyone thought of writing/entering a &nbsp; '''3D''' &nbsp; version of tic-tac-toe for Rosetta Code &nbsp; (as a separate task, of course)?
 
I imagine the programs would get a tad obtuse &nbsp; (hard to follow). &nbsp; -- [[User:Gerard Schildberger|Gerard Schildberger]] ([[User talk:Gerard Schildberger|talk]]) 00:58, 17 April 2016 (UTC)
 
<br>
-----
<br>
 
I wrote a PL/I program &nbsp; (the default grid size was 4x4x4) &nbsp; and it was (an infamous) favorite with the (IBM) OS/MFT operators (in Boston). &nbsp; No terminals with screens back then for our shop &nbsp; --- &nbsp; that was waaaaaaaay back in &nbsp; (cough-cough) &nbsp; <small>1970</small>, &nbsp; ... just the mainframe console &nbsp; (an IBM 1052 typewriter). &nbsp; A lot of time was wasted on the off-shifts and weekends, to be sure. &nbsp; A lot of operators volunteered to work on weekends, and the &nbsp; ''powers-that-be'' &nbsp; never caught on &nbsp; (or just didn't care). -- [[User:Gerard Schildberger|Gerard Schildberger]] ([[User talk:Gerard Schildberger|talk]]) 00:58, 17 April 2016 (UTC)
 
 
The PL/I program had a &nbsp; '''4D''' &nbsp; capability, &nbsp; that is, &nbsp; after so many moves were done &nbsp; (this could be specified at game start), &nbsp; the oldest marker was &nbsp; ''removed'' &nbsp; from the playing grid. &nbsp; -- [[User:Gerard Schildberger|Gerard Schildberger]] ([[User talk:Gerard Schildberger|talk]]) 00:58, 17 April 2016 (UTC)