Coder Social home page Coder Social logo

polish-draughts-csharp-marcellgim's People

Contributors

csizmaziagergely avatar marcellgim avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

polish-draughts-csharp-marcellgim's Issues

Implement board methods

  • There is a ToString() method that overrides the built-in method. This method marks rows as numbers and columns as letters.
  • There is a RemovePawn() method that removes pawns from the specified position.
  • There is a MovePawn() method that moves pawns from a specified position to another field.

Validate inputs

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

Optionals

Optional Tasks

  • Try to implement the singleton pattern. Try to implement additional features such as crowning, multi-jumping, and checking for draw.
  • The Board is a singleton, so it can have only one instance.
  • The Crowned feature is implemented. There is a property on Pawn called bool IsCrowned that returns true if a pawn is crowned and it implements crowning rules.
  • The Pawn class can check if it can make multiple jumps according to the rules.

Check win condition

  • - There is a CheckForWinner() method that checks whether there is a winner after each round.
  • - The CheckForWinner() method also checks for draws.

Define Pawn class

There is a Pawn class.

  • - There is a Color Color property that returns the color of the the pawn (white or black).
  • - There is a (int x, int y) Coordinates property that represents pawn coordinates on a board.
  • - [Extra] There is a bool IsCrowned property that returns true if a pawn is crowned.

Implement game logic

There is a Game class that contains all game logic and actions.

  • - There is a Start() method that starts game between players.
  • - There is a Round() method that determines one-round actions, that is, checks which player is next and whether there is a winner.

Move pawns

  • - The Pawn class contains a method that validates the move (whether it is within the game rules) before it is performed.
  • - [Extra] The Pawn class can check if the pawn can make multiple jumps according to the rules.

Define board class

There is a Board class that represents the square board of Polish draughts.

  • 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.
  • There is a Pawn[,] Fields 2D array that represents fields on a board. Each field can be null (empty) or a Pawn instance.
  • 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.

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.