chess's Introduction
chess's People
chess's Issues
Create move method for Rook
- Are any unique methods needed here, can castling all be done from the King method?
Create move method for Knight
- check this is needed
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://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 a coloured board
Change the board so that it has a coloured background. This can be done with colorize and .on_red - https://www.devdungeon.com/content/colorize-ruby-terminal-output
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.
Reset screen when the player has input the incorrect characters
Clear the screen and re show the board etc when the player puts the incorrect value in. The screen currently adds text below the existing text and it looks messy.
Create a way to add pawn moves based on colour
Pawn moves need to be added to take into account their direction of travel.
Also need to include Pawns being able to move 2 squares for their first move
Create move method for Queen
- determine if this is needed
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
Show who's turn it is all the time
It should be shown under the chessboard who's turn it is and the current piece which they have selected
Create move method for Bishop
- determine if this is needed
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.
Add Moves to all pieces
Add all potential moves for chess pices
Refine Code
Look through all code and refine
Create full instruction set
A full instruction set needs to be created outlining how the game of chess can be played.
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.
Display pieces which players have taken from each other
Pieces should be shown from what the players have taken from each other
Create a method to verify and output a message for if the player is trying to take their own piece
Create a method which describes the move the computer made
Fix issue where the pawn can jump the piece in front of it when making its move forward twice move
Create a concede method
Tidy up Output from friendly_piece method
'That is your own piece, please move to another position or restart your turn' shows twice when the code is ran
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
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.