Giter Site home page Giter Site logo

polish-draughts-java-b-t-nd's People

Contributors

b-t-nd avatar koaru avatar rebekajakob avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

polish-draughts-java-b-t-nd's Issues

Create pawns

Pawns are created and placed on every other field when the board is initialized. Their number is determined by board size, as a 2 * n.

create playRound()

There is a method playRound() that determines one-round actions that is, checks which player is next and whether there is a winner.

[extra] isCrowned

[Extra] There is boolean isCrowned field that returns true if a pawn is crowned.

create tryToMakeMove()

There is a method that checks if the starting position from user input is a valid pawn and if the ending position is within board boundaries. If so, it calls tryToMakeMove() on pawn instance.

validate pawn moves

The Pawn class contains a method that validates the move (whether it is within the game rules) before it is performed.

create checkForWinner()

There is a checkForWinner() method that checks whether there is a winner after each round.

create class for Coordinates

There is a field of the Coordinates position class that represents pawn coordinates on a board. The Coordinates class has two fields, Integer x and Integer y.

Create pawn fields

There is a Pawn[][] fields 2D array that represents fields on a board. Each field can be null (empty) or a Pawn instance.

Create Board constructor

There is an n parameter in the constructor that specifies the side length of the square. The size must be an integer between 10 and 20. It is provided as user input.

Create toString() method

There is a toString() method that overrides the built-in method. This method marks rows as numbers and columns as letters.

add demo/test cases

add new board states
change board constructor to change which board to load
chage game constructor to take a variable that determines what board is loaded

pawn.getcolor()

There is a Color getColor() method that returns the color of the the pawn(white or black).

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.