Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Tic tac toe

by delirium (Chaplain)
on Jun 04, 2004 at 13:57 UTC ( #360872=note: print w/ replies, xml ) Need Help??


in reply to Tic tac toe

Can anyone come up with a shorter one?
Only 4 years late, but yes:

@r=(123,456,789,147,258,369,159,357);$,=$/;$p=X; sub d{print@r[0..2],$p;die$_[0]if@_} n:d;$m=<>until grep$m=~/\d/&&s/$&/$p/,@r; d"Tie"if!map/\d/,@r;d$p if map/$p{3}/,@r; $p=~tr/XO/OX/;goto n
190 characters.


Comment on Re: Tic tac toe
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (5)
As of 2014-12-26 03:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (164 votes), past polls