Git Product home page Git Product logo

boardgames's People

Contributors

oggy22 avatar

Watchers

 avatar

boardgames's Issues

Array sum game

Implement array sum game where each player can take either the most-left or most-right element. The winner is the one whose sum of picks is higher.

Chess puzzles tests

Write several tests for minmax algorithm asking it to solve a chess puzzle mate in 1,2,3,4 moves.

Helper function may help:

void FindCheck(string pgn, string expected_fen, int moves)

Checkers

Implement checkers to a reasonable level. Try sharing implementation with chess.

Chess tests: random and minmax

Couple of ideas for tests:

  • Test where each player plays a random move. Quite after ~500 moves.
  • Test: Random vs minmax(2), minmax is expected to win
  • Test: minmax(2) vs minmax(4), minmax(4) is expected to win
  • etc.

Implement castling move

https://en.wikipedia.org/wiki/Castling

For castling move to be valid check, in this order:

  • King is in its initial position
  • Rook is in its initial position
  • Squares in between are empty
  • King is not checked
  • Kind is not checked after castling
    It would be nice to check if king and rook have moved before as well.

Minmax on tictactoe

Tests:

  • minmax(10) - draw
  • 3/1XO/3 - X wins, check all 4 rotations
  • 3/1X1/2O - draw, check all 4 rotations
  • one move to win, check all 4 rotations
  • fork and then win, check all 4 rotations

Random move generator

Implement a function like this which will work for any board.

template <Board B, Move m>
static Move random_move(Board& B);

Incremental minmax

Implement incremental minmax algorithm. For example if depth=10, the algorithm runs for depth=2 first, then 4, 6, 8 and finally 10. Each run will have killer moves initialized for the next run, thus it will speed up the search. Note that killer moves are stored per depth, so running the algorithm for depth=2 will initialize killer moves for depth=1,2, running it for depth=4 will initialize depth=1,2,3,4 etc.

This depends on #2

Customizable chess evaluation function

Using templates and if const implement something like following:

template <
int material=1,
int almost_promoted=0,
int king_protection=0,
int coverage=0
int legal_moves=0>
>
int evaluate()
{
  int ret = 0;
  if const (material > 0) ret+= material * evaluate_material();
  if const (almost_promoted) ret+= almost_promoted * almost_promoted_evaluate();
  if const (king_protection) ret+= king_protection * king_protection_evaluate();
  if const (coverage) ret+= coverage * coverage_evaluate();
}

Random chess games experiment

Perform a fixed number of random chess games, for example 100. Random chess game is a game where both players take random move out of all legal moves available in each position. Get the following calculations/stats:

  • How often white/back wins?
  • How often is a draw? Two kings left vs stalemate.
  • Average game for each category,

Perform the experiment multiple times and make sure the results are consistent.

MinMax with cutting

Get minmax algorithm work reasonably well with chess, MNK and Connect4. Include alpha-beta cutting.

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.