Git Product home page Git Product logo

chess's Introduction

In-Console Chess

Introduction

This is the second in-Console chess program I have created after this.

I first created a chess program using Python in my senior year of high school to challenge myself to solve complex problems using my beginner understanding of the language and coding in general. I created this program a year later after studying Java at UBC in my first year. This was a much better and more organized program than my first attempt due to my increased experience with programming and knowledge of more concepts such as OOP. I wrote this code to not only track my progress as a programmer, which is visible in the efficiency and organization in this code compared to that of my first program but also to test whether I completely grasped all the concepts I was taught in class.

I am keen to see how I can advance my program more once I learn further programming concepts.

The program is fully functioning as-is, however, please do keep checking the currently known issues in the Issues section to stay up to date about the program's failures and drawbacks.

Walkthrough

On loading the program, the text output in the console displays a chess board made with UNICODE characters.

image

(Note that in this image the colors of the chess pieces are inverted due to a dark display theme of the IDE. The set of pieces on the bottom of the board are white.)

Each square on the board has a coordinate such as 1A, 2B, and so on until 8H. The program asks you to enter the current coordinate of the piece you want to move and then the coordinate of the destination square.

It prompts the first player (controlling white pieces) to play. If either of the coordinates entered is invalid, the program shows an error message accordingly.

image

If the move is valid, it updates the board visualization with the move and asks the opposing player to make a move after.

image

Similarly, the program allows for a full-fledged chess game to be played on the computer. It contains code for the restricted movement of all chess pieces and also includes programming for features such as castling, pawn upgrades, check, etc.

Typing in "rules" at any point displays all the rules to use the program and classical chess.

image

Future Development Ideas

This program is far from complete. I want to add several features over time, including some of the following:

  • A GUI implementation of the chessboard
  • Automatic detection of a checkmate
  • In-game clock
  • Single Player Mode against the computer
  • A mode which shows suggested moves which help people learn the game
  • Generation of an exportable transcript of each game and a GUI to access all stored transcripts on the computer, along with a leaderboard based on them

Updates and Fixes

July 2023

  • Added game rules to a .txt file
  • Updated README.md

May 2023

  • Fixed display issues
  • Updated README.md

July 2022

  • Uploaded Project Files to GitHub

chess's People

Contributors

gracetownland avatar rajveersodhi avatar

Watchers

 avatar

chess's Issues

Display Issues

While everything else works, the one issue I haven't been able to fix is the issue with the chess board printing out improperly due to the widths of different chess piece characters being different. Still in progress.

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.