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

It exits when one of the players wins.

Slick piece of code BTW.

/\/\averick

Replies are listed 'Best First'.
RE: RE: RE: Tic tac toe
by BigJoe (Curate) on Aug 17, 2000 at 19:06 UTC
    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.
      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.