Tic-Tac-Toe Logic

App SurgeApp Surge Member Posts: 651
edited November -1 in Working with GS (Mac)
Hey there everyone,
I am creating a tic-tac-toe like game, and just wanted your opinions on how to get the game to recognize when you have three in a row. (Mine will actually be 5.)

Thanks,
Henry

Comments

  • App SurgeApp Surge Member Posts: 651
    Bump
  • hman360hman360 Member Posts: 590
    I know exactly how, email me @ hapiapps[at]gmail[dot]com, it is a little complicated, especially diagonals.
  • old_kipperold_kipper Member Posts: 1,420
    It's 8 checks that can be run from the centre of row/rank, and the diagonals run from the centre. It checks it own state and that of the row desired for match. It's probably best to have 9 integer attributes for the state of each space, giving 0,1,and2 for no mark, 1 for an x and 2 for a O.
    An actor can sit in each space and dependant on turn order switch to x or O, then run the checks.

    Hope that helps. It a puzzle sorting It out but a fun one.

    Kipper
  • quantumsheepquantumsheep Member Posts: 8,188


    :D

    Dr. Sam Beckett never returned home...
    Twitter: https://twitter.com/Quantum_Sheep
    Web: https://quantumsheep.itch.io

  • DZTECHDZTECH Member, PRO Posts: 216
    I made a tic tac toe game using the code from deep blue apps cookie match template to recognize when there is three in a row.
  • App SurgeApp Surge Member Posts: 651
    zakdavid said:
    I made a tic tac toe game using the code from deep blue apps cookie match template to recognize when there is three in a row.

    Great, thanks! How did you do that though?
  • DZTECHDZTECH Member, PRO Posts: 216
    buy his template and go look at the code for the controller actor. he has notes and it will show you what code to use and just copy and paste.
  • App SurgeApp Surge Member Posts: 651
    Awesome! Thanks a ton
  • App SurgeApp Surge Member Posts: 651
    Bump
Sign In or Register to comment.