in reply to Tic tac toe

Pretty slick but there is no way to exit.

--BigJoe

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

Replies are listed 'Best First'.
RE: RE: Tic tac toe
by maverick (Curate) on Aug 17, 2000 at 18:53 UTC
    It exits when one of the players wins.

    Slick piece of code BTW.

    /\/\averick

      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.