Giter Club home page Giter Club logo

chess's Introduction

chess's People

Contributors

billyboy118 avatar

Watchers

 avatar

chess's Issues

Check methods

Create methods for check a. this method wil need to run every turn. I may also need to create a method in the King class itself to ensure that it doesn't put itself in check/mate, this will now be done in this class.

  • Create a method where for the player it identifies if they are in check at the beginning of their go
    • Communicate that the king is in check
    • Make sure that if the players piece is in check that the only move which can make will bring the piece out of check
  • Make a method which does not let the player intentionally put their king into check
  • Make a method which identifies if yo have put the opposition into check
  • This should be communicated to the player
  • Once check has been established checkmate should then be looked for by searching for check on all of the kings potential moves
  • Tighten up check/checkmate methods

Computer player

Make the game so that the player can play against the computer

  • make it so that the computer automatically selects their promotion choice
  • Look at why the computer is able to make illegal moves - I seen this happen with the king and pawn, looks like this happens when the king is in check
  • The game goes funny wit check/checkmate moves - revisit this once I have solved check/checkmate move

Create move method for King

  • determine if this is needed
  • create methods whereby the king can only move 1 square at a time
  • create castling method
  • castling is when the king makes 2 moves to the left or two moves to the right, either way the rook will move to the opposing side of the King
  • you cannot castle while in check
  • castling can only occur when it is the first move for both pieces
  • you cannot castle if there are any pieces inbetween the king and the rook

https://en.wikipedia.org/wiki/Castling#:~:text=Castling%20is%20a%20move%20in,of%20the%20player's%20original%20rooks.&text=Castling%20consists%20of%20moving%20the,square%20that%20the%20king%20crossed

https://www.youtube.com/watch?v=FcLYgXCkucc&ab_channel=Chess.com

Create a module for checkmate

This will need to run on every turn.

  • create method to check for checkmate
  • create end game method (do you want to restart etc)

Sort out the king

When moving the King it can move more than one space at a time anywhere on the board. I believe that this issue will be resolved once I have done the King methods.

Create method/methods which allows pieces to move given their legal moves

I think that I will be able to create a generic method here for some pieces but then more individual specific methods will need to be created for the individual pieces.

  • create a loop so that queen, bishop and rook can move x times
  • create a method which stops pieces moving if other pieces are in the way

Create Save/Load method

  • work in en passant - will need to move the class variable into the board instance
  • change the welcome message when a game is loaded

Display which piece the player currently has selected

While it is a players turn ensure that the current piece they have selected is on constant show. Currently if they make and illegal move it disappears.

Here I could display bot the piece and the location of piece. I could create a new instance variable here if it cannot be done with game_message.

Add Take Piece Methods

Add a method which alerts that a piece has been taken this should do the following

  • Store the taken piece somewhere so that it can be used to display all taken pieces
  • Output a message highlighting that a piece has been taken
  • I could possibly put a confirmation take piece method in here

Create Load Method

A load method needs to be created. This will need to be accessed from the initial load screen and also the main menu during the game.

Create Stalemate Module

Within this module I will need to simulate every move. This will be easy for all pieces apart from the King. I think that I can maybe run the legal move method and if the potential_move variable for a piece has something in its array then it is not a stalemate. If all pieces do not contain anything within the potential_move variable then it will be a stale mate. When will I run the stalemate method? I think that I will be able to run this before or after the checkmate method.

Create move method for Pawn

This will include

  • diagonal take move - this is rough as shit and I need to sort it out
  • 2 forward on first move
  • En passant
  • Method for when the pawn reaches the end of the board and can turn into any piece
  • need to stop the pawn being able to take pieces moving forward - I think that I should be able to incorporate this into the diagonal method

Knight issue

The black knight will put the king in checkmate if it makes its way to C2 from the beginning while the left most pawn works its way up.

Use index instead of co-ordinates

I think that it could be easier to use indexes for a number of methods instead of the co-ordinates, look at how I did this with the pawn_move method. this is a big piece of work but it could help shorten a couple of methods, maybe in the display board module.

knight issue

There is an issue where when I move the knight the whole game freezes but I don't know or what causes the issue - this could be linked to one of the bug I found while creating the computer game mode, I need to try and force this error again to figure out if this is an issue.

Fix issue where check/checkmate doesn't work

I think that this is issue is caused by the loop method when working out the check/checkmate move. The game currently allows you to move the King away from the piece which has it in check, eg. moving it away from the queen
Screenshot from 2021-06-27 09-39-54

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.