Beefy Boxes and Bandwidth Generously Provided by pair Networks vroom
Perl Monk, Perl Meditation
 
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 wandering the Monastery: (10)
As of 2014-04-18 11:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (466 votes), past polls