https://github.com/scriptraccoon/chess-singleplayer
Chess program with Vanilla JS
https://github.com/scriptraccoon/chess-singleplayer
Last synced: over 1 year ago
JSON representation
Chess program with Vanilla JS
- Host: GitHub
- URL: https://github.com/scriptraccoon/chess-singleplayer
- Owner: ScriptRaccoon
- License: mit
- Created: 2020-06-05T21:26:42.000Z (almost 6 years ago)
- Default Branch: main
- Last Pushed: 2024-01-26T00:02:42.000Z (over 2 years ago)
- Last Synced: 2024-05-30T16:49:51.568Z (about 2 years ago)
- Language: JavaScript
- Homepage: https://chess-singleplayer.netlify.app
- Size: 8.24 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Chess (single player)
Demo: https://chess-singleplayer.netlify.app
This is a chess program made with HTML, JavaScript and CSS without any frameworks or libraries.
In the control panel on the left (or bottom on mobile devices), you can see the current turn, rotate the board, restart, draw and resign the game. You can also toggle highlights
for the previous move, allowed squares and checks.
In the board in the middle, you can move the pieces either by selecting them with a click and then selecting their target square or by dragging and dropping them.
In the notation panel on the right (or top on mobile devices), you can see the previous moves. You can also click on them or use the arrow keys to restore previous game positions.
The game outcome is also displayed here.
Apart from stalemate there are three situations in which the game automatically draws:
- There is insufficient material.
- For 75 moves no pawn has been moved and no piece has been captured.
- The same position has been on the board for 5 times for the same player.
Chess is played with two players, but currently this program only works in one window in which both players have to alternate making moves.
The game design is responsive, so that it changes when you resize the window or use a mobile device.