Giter VIP home page Giter VIP logo

checkers-with-ai's Introduction

Checkers-with-AI

wakatime Lines of code GitHub commit activity

Description

Checkers was a first project that I made in my first year of university. It has been really close to my heart. In this project I tried to make a game that is not only a game but also a game that is fun to play. The code is completely new from the scratch. The logic is pretty simple and the game is fun to play.

Dependencies

Python3.6 or above and a computer that can run it.

How to play

Simply enter the coordinates of the board and the piece you want to move. The terminal will show you the board like this, with some extra information.

   0  1  2  3  4  5  6  7
0  ⚫ ⚫ ⚫ ⚫ ⚫ ⚫ ⚫ ⚫
1  ⚫ ⚫ ⚫ ⚫ ⚫ ⚫ ⚫ ⚫
2  ⚫ ⚫ ⚫ ⚫ ⚫ ⚫ ⚫ ⚫
3  🟨 🟥 🟨 🟥 🟨 🟥 🟨 🟥
4  🟥 🟨 🟥 🟨 🟥 🟨 🟥 🟨
5  ⚪ ⚪ ⚪ ⚪ ⚪ ⚪ ⚪ ⚪
6  ⚪ ⚪ ⚪ ⚪ ⚪ ⚪ ⚪ ⚪
7  ⚪ ⚪ ⚪ ⚪ ⚪ ⚪ ⚪ ⚪

Black:  24
White:  24
Move: 0

Enter your move dear human.

Now you have to give the moves you want to play. For example I want to move the piece from (5,3) (5th row and 3rd column according to the board) to (4,4). I will write each of them in order and when the I have to stop simply write q (short form for quit) in the input.

Enter your move dear human.
5 3
4 4
q

Hit enter the your move will be played by the computer.

   0  1  2  3  4  5  6  7
0  ⚫ ⚫ ⚫ ⚫ ⚫ ⚫ ⚫ ⚫
1  ⚫ ⚫ ⚫ ⚫ ⚫ ⚫ ⚫ ⚫
2  ⚫ ⚫ ⚫ ⚫ ⚫ ⚫ ⚫ ⚫
3  🟨 🟥 🟨 🟥 🟨 🟥 🟨 🟥
4  🟥 🟨 🟥 🟨 ⚪ 🟨 🟥 🟨
5  ⚪ ⚪ ⚪ 🟩 ⚪ ⚪ ⚪ ⚪
6  ⚪ ⚪ ⚪ ⚪ ⚪ ⚪ ⚪ ⚪
7  ⚪ ⚪ ⚪ ⚪ ⚪ ⚪ ⚪ ⚪

Black:  24
White:  24
Move: 1

After this instantly your opponent the might computer will play the move. The board may pass on quickly and to keep the record of which move has been played we added a green sqaure in the path of each hop.

   0  1  2  3  4  5  6  7
0  ⚫ ⚫ ⚫ ⚫ ⚫ ⚫ ⚫ ⚫
1  ⚫ ⚫ ⚫ ⚫ ⚫ ⚫ ⚫ ⚫
2  🟩 ⚫ ⚫ ⚫ ⚫ ⚫ ⚫ ⚫
3  🟨 ⚫ 🟨 🟥 🟨 🟥 🟨 🟥
4  🟥 🟨 🟥 🟨 ⚪ 🟨 🟥 🟨
5  ⚪ ⚪ ⚪ 🟥 ⚪ ⚪ ⚪ ⚪
6  ⚪ ⚪ ⚪ ⚪ ⚪ ⚪ ⚪ ⚪
7  ⚪ ⚪ ⚪ ⚪ ⚪ ⚪ ⚪ ⚪

Black:  24
White:  24
Move: 2

Enter your move dear human.

Now you have to enter the move again. The game will keep on going until one of the player wins or game draws.

checkers-with-ai's People

Contributors

qazalbash avatar smabbasht avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

smabbasht

checkers-with-ai's Issues

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.