Giter Club home page Giter Club logo

noughtsandcrosses's Introduction

Noughts and Crosses

A simulation of the simple game Noughts and Crosses AKA Tic Tac Toe.

It includes the ability for one or two users to play it on the command line and I aim to add some AI too.

Usage

Run gradle -q --console plain run to run the CLI. The extra options mean Gradle doesn't print everywhere around the user input and standard output. To test run gradle test.

How the board game works

In the standard game, the grid is 3 by 3, but it works with different sized grids.

There are two players, one of which is assigned noughts and the other is assigned crosses. That take turns to place their piece in an unoccupied tile on the board. The winner is the first player to make a whole row, column or diagonal of their pieces.

Files

  • Piece.java: An enum containing the possible pieces - nought, cross or blank.
  • Board.java: An object representing the board, with methods to place a piece in a location and check for the winner, etc.
  • CLI.java: The command line interface.

CLI

Available modes for the command line interface

  • Single player random
  • Multiplayer

noughtsandcrosses's People

Contributors

jamesw1892 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.