Giter VIP home page Giter VIP logo

tic-tac-toe-java's Introduction

Tic Tac Toe

Ensure that your main class is com.tw.step8.ttt.Main. Tests are expected to be written. The folder structure should be standard with src in src and tests in test. Do not use any libraries other than JUnit.

Implement the tic tac toe game.

The game keeps displaying the tic tac toe board, giving instructions, and taking in player’s move in a loop until the game finishes with the game ending in a draw or with one of the players winning.

java -jar ttt.jar Ramesh Suresh
---------------------
  Ramesh:x Suresh:o
    1  2  3
    4  5  6
    7  8  9
  Ramesh's turn. Please enter the cell number > 1
---------------------
  Ramesh:x Suresh:o
    x  2  3
    4  5  6
    7  8  9
  Suresh's turn. Please enter the cell number > A
  *ERROR* Invalid Cell A, Please provide a vacant cell between 1-9
  Suresh's turn. Please enter the cell number > 1
  *ERROR* Cell 1 is Not Vacant, Please provide a vacant cell between 1-9
  Suresh's turn. Please enter the cell number > 2
---------------------
  Ramesh:x Suresh:o
    x  o  3
    4  5  6
    7  8  9
  Ramesh's turn. Please enter the cell number > 
~~ and so on till the game finishes ~~
---------------------
  Ramesh:x Suresh:o
    x  o  x
    o  x  o
    x  o  x
  Ramesh wins
---------------------
  Ramesh:x Suresh:o
    x  o  o
    x  o  x
    o  x  x
  Game ended in a Draw

tic-tac-toe-java's People

Contributors

barnaligorai avatar github-classroom[bot] avatar

Watchers

 avatar

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.