Code Monkey home page Code Monkey logo

chess's Introduction

Chess

A fully functional chess game that can be played with two players in the terminal.

Play online on Replit.

Demo

Demo

This demo shows a game that culminates in the fool's mate, which is the checkmate delivered after the fewest possible moves from the game's starting position.

Features

  • Game saving and loading
  • Piece selection and move highlighting
  • Declares checkmates and stalemates when present
  • Prevents users from making illegal moves
  • Handles special moves such as castling and en passant
  • Allows users to propose and agree to draws
  • Tested with RSpec

How to Use

To play online, go here.

To play locally, you must have Ruby installed. This program was written in Ruby 3.1.

If you have Ruby installed, clone this repository:

$ git clone [email protected]:kathleenmoran/chess.git

Navigate to the top level folder and run ruby lib/main.rb.

To run the tests you must have RSpec installed. These tests were written using RSpec 3.11.

Execute the tests by typing rspec.

Style Guide

Written with the community Ruby style guide.

Future Improvements

  • Separate move logic in Board class into individual classes
  • Add option to play against the computer
  • Allow users to play a game by uploading a text file containing FEN
  • Enforce the fifty-move rule
  • Add integration tests

Gratitudes

This project is based off of an assignment from The Odin Project. Inspiration for the layout of this README was drawn from ChargrilledChook's READMEs.

chess's People

Contributors

kathleenmoran avatar

Watchers

James Cloos avatar  avatar

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.