Giter Club home page Giter Club logo

alphadraughts's People

Contributors

ttitcombe avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

alphadraughts's Issues

Create self-play mode

A game should be able to be played by two algorithms.
Self-play mode requires no human input.

Create basic bot

A basic alpha-beta algorithm should be created against which a user can play. This tests the game and how well it works with algorithms

Add game loop

Update Game so that a new game can be started and moves can be made alternative between white and black

Create gameplay tests

Create a suite of tests in which games are played in full. The tests should check that all moves are made as expected, pieces are taken when expected, and the result is correct.

These tests should be run after the unit tests as they will take a longer time to fail and are less fundamental

Update RULES.md

Fill in information about the pieces and promotion.
Format the board layout

Allow promotion to Kings

Currently, pieces which get to the end of the board are stuck.
When this happens, the pieces should be promoted to Kings and allowed to move in both directions

Takes don't appear in valid moves list

Takes don't appear in valid moves list. This can lead to a stalemate with the RandomBot as it randomly selects a move from the list of valid moves.

To replicate this issue:

  1. Run scripts/play_bot.py
  2. Play until you can take a piece
  3. Type help. The take will not appear in the moves list

Create basic self-play algorithm

Create a basic algorithm which takes the board as input and predicts a move.
See how well this model can learn playing against itself, using sparse rewards (win or lose) and frequent rewards (take or lose a piece)

Add human v bot mode

Allow one of the players to be an algorithm.
The exact format of the algorithm should be irrelevant, but there must be a common way of getting the move from the algorithm into the game object

Add pre-commit

Add information to README on how to set-up pre-commmit. Add the pre-commit hooks (black) to the project

IndexError when taking pieces

An IndexError is raised when taking a piece on the board.

To replicate:
Run python -m scripts.play_game to play a game on the command line for both white and black.
Enter the following sequence of moves:

  • 25-22
  • 5-9
  • 22-18
  • 9-14
    When you enter 18-9 to take the black piece, an IndexError is raised

Stalemates are not determined

The game does not calculate if a stalemate has occurred. This can lead to infinite play.

To replicate:
Play a random bot against a random bot, using the following script

from alphadraughts import Game, RandomBot

game = Game(white=RandomBot(), black=RandomBot())
game.play()

There may be a breakthrough, but most of the time the game will continue indefinitely (stalemates occur frequently because of #23 - pieces block the middle which leaves the remaining pieces and kings to wander about aimlessly)

Allow command line play

A game should be playable via the command line (i.e. no python).
Optional args should be:

  • Best of (i.e. how many games must be played)

After each move, the updated board should be printed out

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.