DEV Community

R Ajeti
R Ajeti

Posted on

3

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

Billboard image

Create up to 10 Postgres Databases on Neon's free plan.

If you're starting a new project, Neon has got your databases covered. No credit cards. No trials. No getting in your way.

Try Neon for Free →

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay