Giter Club home page Giter Club logo

tic-tac-toe's Introduction

Tic tac toe terminal game!!

We wrote our own version of one of the most iconic (and played) games in history: tic-tac-toe.

As this project is quite big, it required separate milestones with code reviews for each branch.

Code execution view:

screenshot

Demo Link

Live Demo Link.

Built With

  • Ruby!
  • VsCode

Getting Started

To get a local copy up and running follow these simple example steps:

  • Clone this repository into your local machine.
  • Run the main file by typing this in your command line:
  $ cd tic-tac-toe
  $ cd bin
  $ ruby main

How to play

This is a 2 player game.
Firstly, the program asks for each player's name and their preferred symbol which can be any keyboard character (we recommend letters or numbers).

Afterwards, the game begins presenting the tic-tac-toe board:

[1 2 3] 

[4 5 6]

[7 8 9]

Now players need to take turns to put their symbol into the 9 legal positions, 1 at a time. A player symbol cannot overwrite the opposing player's symbol. Each move should be on different positions.

The goal of the game is to fill the positions with a player's symbol 3 times in a row.
The rows can be vertical, horizontal, and diagonal.

If no player can fill a row after all positions are filled, the game is considered a draw.

For instance:

[X 2 3] 

[4 X 6]

[7 8 X]

Draw game example:

[o x o] 

[x x o]

[x o x]

Validators

  • Rubocop
  • Stickler

Authors

👤 Elias Castañeda

👤 Miguel Tapia Escalera (Meltrust)

🤝 Contributing

Contributions, issues and feature requests are welcome!

Feel free to check the issues page.

Show your support

Give a ⭐️ if you like this project!

Acknowledgments

  • Hat tip to anyone whose code was used
  • Inspiration
  • etc

📝 License

This project is MIT licensed.

tic-tac-toe's People

Contributors

meltrust avatar eliasecasta avatar

Stargazers

Sajjad Ahmad avatar peris ndanu avatar Michael Threels avatar Carlos Flores avatar Carlos Santamaría avatar Seth Zea avatar Mauricio Robayo avatar Osong Agberndifor avatar Cristian Viorel Ceamatu avatar  avatar Victor Manuel Gonzalez Buitrago avatar Yahir Cardona avatar

Watchers

 avatar

tic-tac-toe's Issues

Code Review

Hi Elias!!!!
I think you have done an amazing job with the project. It's working well for most parts hehehehe, now lets make it perfect

  • After a user inputs their name, you can assign them a symbol

  • Give descriptive error messages especially when a user gives an input that is outside the given scope

  • Validate user names, give them a max length and ensure no empty strings are given as input

  • Try and avoid alot of puts in the main file

  • You can use gems to make your outputs pretty

  • Make use of ruby center method to align your board arrays

  • Fix the broken parts of your code 😄

  • (Optional) You can render the board back once a game is over

Happy coding 😄 💻 💯

KInd Regards
Peris Ndanu

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.