Giter Site home page Giter Site logo

chesssimple's Introduction

Chesssimple

Chesssimple is a very simple Chess game that implements almost all the chess rules and includes a very simple AI. The purpose of this project is to learn Haskell and functional programming concepts; in fact, this was my project of a semestral functional programming course at UNLP.

Instalation and execution:

./chesssimple> cabal update
./chesssimple> cabal install
./chesssimple> ./dist/build/chesssimple/chesssimple

Executable options and help

There are 3 game modes with their own options:

  • hvc: Human vs Computer (default)
  • hvh: Human vs Human
  • cvc: Computer vs Computer
The Chesssimple program

Chesssimple [COMMAND] ... [OPTIONS]
  Chess game & engine

Common flags:
  -? --help            Display help message
  -V --version         Print version information

Chesssimple hvh [OPTIONS]

     --p1name=ITEM     The player 1's name
     --p1color=ITEM    The player 1's color
     --p2name=ITEM     The player 2's name

Chesssimple [hvc] [OPTIONS]

     --hname=ITEM      The human player's name
     --hcolor=ITEM     The human player's color
  -c --cstrength=INT   The computer player's strength

Chesssimple cvc [OPTIONS]

     --p1strength=INT  The player 1's strength
     --p2strength=INT  The player 2's strength

For instance:

./dist/build/chesssimple/chesssimple hvc --cstrength=2 --hcolor=black

Will start a game where human player will be the black team and computer game will have a strength of 2 (very easy)

Execution with threads:

Add these parameters to the chesssimple command: +RTS -Nt, where t is the number of threads. For example:

./chesssimple> ./dist/build/chesssimple/chesssimple hvc --cstrength=2 --hcolor=black +RTS -N4

Will start a game with 4 threads.

Tests

Run it with:

./chesssimple> ghci < runtests

More docs:

There is a .tex file which contains technical information of Chesssimple (only in Spanish)

TODOs:

  • Implement castling
  • Implement in passant rule
  • Implement a better piece promotions
  • Add and improve all tests suit.

chesssimple's People

Contributors

lndl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 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.