Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re^3: (Golf) Tic Tac Toe

by thospel (Hermit)
on Jun 07, 2004 at 16:24 UTC ( #362035=note: print w/ replies, xml ) Need Help??


in reply to Re^2: (Golf) Tic Tac Toe
in thread (Golf) Tic Tac Toe

Forgot to do the final situation print in that 124, but now it prints the person whose turn is WAS.

s//123 456 789 z147,258,369,159,357/;$p=O;{/z/;print$`.$p;/$p{3}/?die$p:/\d/?$p^=O^X: +die Tie;1until<>=~/\d/&&s/$&/$p/g;redo}


Comment on Re^3: (Golf) Tic Tac Toe
Download Code
Re^4: (Golf) Tic Tac Toe
by thospel (Hermit) on Jun 07, 2004 at 17:11 UTC
    Printing flaw fixed, and to 119:
    s//123 456 789 z147,258,369,159,357/;$p=O;{/z/;print$`,$p^=O^X;/(.)\1\1/?die$1:/\d/|| +die Tie;$?=<>until s/$?/$p/g;redo}
    Re^5:
    by Jasper (Chaplain) on Jun 17, 2004 at 16:22 UTC
      CORRECTION: I am stupid, after all.

      The OPs method of checking the verticals and diagonals was pretty clever.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://362035]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (9)
As of 2014-08-28 06:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (257 votes), past polls