in reply to RE: RE: Tic tac toe
in thread Tic tac toe

Tried that and it didn't exit. i had 3 accross the middle just playing. Then I went and filled every one and it still didn't let me out.

--BigJoe

Learn patience, you must.
Young PerlMonk, craves Not these things.
Use the source Luke.

Replies are listed 'Best First'.
RE: RE: RE: RE: Tic tac toe
by turnstep (Parson) on Aug 17, 2000 at 20:34 UTC
    BigJoe is right, the part of the code that checks for a horizontal match is incorrect. Right after the for loop, where it says:
    s/$P{3}/$&/;
    it should say something like:
    s/($P.?)$&/;

    Very nice code! :) I like the way that $& is used.