DEV Community

R Ajeti
R Ajeti

Posted on

Game Tic Tac Toe

Tic-tac-toe, noughts and crosses, or Xs and Os is a paper-and-pencil game for two players, X and O, who take turns marking the spaces in a 3Γ—3 grid. The player who succeeds in placing three of their marks in a horizontal, vertical, or diagonal row wins the game.

Top comments (2)

Collapse
 
oinak profile image
Oinak

That is a very interesting approach

I have used ruby tic-tac-toe as a refactoring exercise in the past to practice object oriented coding, I hope you like seeing a different take on the same problem: gist.github.com/oinak/d6421cacc895...

Collapse
 
baweaver profile image
Brandon Weaver

The fun thing about TicTacToe is you can derive all the potential win conditions.

This may give you some fun ideas of what else is possible in Ruby: repl.it/repls/FragrantChillyCarriers