GFSSOC '14 Winter J4 - Tic Tac Moe!

View as PDF

Submit solution


Points: 5 (partial)
Time limit: 1.0s
Memory limit: 16M

Authors:
Problem type

Griffy was about to finish the elusive A Times B problem, when Timothy Li scoffed at him and challenged him to a blind tic-tac-toe match! Griffy is playing as O and Timothy is playing as X. After a sequence of random moves, a 3 by 3 board has been filled with Os and Xs. Both Timothy and Griffy are stuck trying to get their blindfolds off (can't write a program for that, unfortunately), so you decide to determine who wins to avoid 5 hours of blindfold-taking-off.

Note: A player wins if there are 3 of the same character in a row, column or diagonal. A player winning in multiple ways in one game is a valid win.

Input Specification

3 lines, representing a grid.

Output Specification

One line, output the string:

  • Error, redo if both Os and Xs win,
  • Tie if neither player wins,
  • Griffy if only O wins,
  • Timothy if only X wins.

Sample Input

OOX
XOX
XXO

Sample Output

Griffy

Comments


  • 0
    iWolf22  commented on June 22, 2021, 2:27 a.m.

    Why does my code die for a select couple test cases?


    • 1
      Badmode  commented on June 22, 2021, 3:23 a.m. edited

      There are two errors on line 27 in your latest submission. Please join Discord and post your problem in the "help" channel next time to avoid cluttering up the comment section.


      • 1
        iWolf22  commented on June 24, 2021, 5:31 p.m.

        Thanks bro :)


  • 9
    bariumlanthanum  commented on May 28, 2020, 8:38 p.m.

    if the output is text, how do they see it without taking their blindfolds off?


    • 0
      amolven16  commented on June 4, 2020, 5:03 p.m.

      True


  • 0
    vpro8725  commented on Oct. 25, 2019, 11:38 p.m.

    Wait up. I got the code and everything working. I am consistently getting the 'Error, redo' and 'Tie' cases wrong. I made an echo program to get the inputs they're using. Plugging in the numbers results in the correct output for the case. Am I getting the string to output wrong? I'm outputting these strings for each respective scenario: Error, redo Tie Timothy Griffy. Keep in mind that the Griffy and Timothy cases are AC...


    • 1
      Dingledooper  commented on Oct. 26, 2019, 12:21 a.m.

      You should re-read the output specifications. It says to print Error, redo if both Os and Xs win, and Tie if neither player wins.


      • 2
        vpro8725  commented on Oct. 26, 2019, 12:33 a.m.

        Oh. That's just me being an idiot. Thanks!


  • -1
    DA_BIG_MO  commented on Jan. 9, 2019, 5:19 a.m.

    why have i got only one of the many subtest wrong?


    • 1
      geese  commented on Jan. 9, 2019, 6:36 p.m.

      Your issue is in scenarios where both Os and Xs win.


  • -4
    DA_BIG_MO  commented on Jan. 8, 2019, 9:30 a.m.

    is that a zero or an o


    • 1
      JustinXu  commented on Jan. 8, 2019, 1:49 p.m.

      O


  • 0
    Kirito  commented on March 23, 2016, 2:20 a.m.

    As I learned, P5 doesn't imply Timothy won all the games. -_-