+ 3

[ASSIGNMENT] Tic Tac Toe

It's time for another challenge, this time a little easier. Write a program, that accepts three strings with three characters each (out of x, o, -) representing player marks or empty cells in a game of Tic Tac Toe. If x wins, the code should print x, if o wins it should print o and - in case of a draw. Best answer for the shortest or most elegant solution, but everyone who tries will get a like.

3rd May 2017, 4:25 PM
Tob
Tob - avatar
3 Answers
+ 3
Examples: xxo oox xox returns - xo- xxo x-o returns x oxx xoo ox- returns - ox- -ox --o returns o
3rd May 2017, 4:28 PM
Tob
Tob - avatar
+ 4
This would be my solution. Kinda crazy and heavily inspired by a post about Connect Four I read a while ago. https://code.sololearn.com/cOeXWQUN3rpR
3rd May 2017, 5:16 PM
Tob
Tob - avatar
21st Feb 2018, 7:23 PM
Baraa AB
Baraa AB - avatar