## GFSSOC '14 Winter J4 - Tic Tac Moe!

View as PDF

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

• commented on June 21, 2021, 10:27 p.m.

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

• commented on June 21, 2021, 11:23 p.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.

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

Thanks bro :)

• commented on May 28, 2020, 4:38 p.m.

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

• commented on June 4, 2020, 1:03 p.m.

True

• commented on Oct. 25, 2019, 7: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...

• commented on Oct. 25, 2019, 8:21 p.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.

• commented on Oct. 25, 2019, 8:33 p.m.

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

• commented on Jan. 9, 2019, 12:19 a.m.

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

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

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

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

is that a zero or an o

• commented on Jan. 8, 2019, 8:49 a.m.

O

• commented on March 22, 2016, 10:20 p.m.

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