Skip to content

asenovm/Reversi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

116 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Reversi

=======

About

An implementation of the Reversi/Othello game, written in Java/Swing and featuring AI opponent.

gameplay

AI opponent

The AI opponent is implemented using the Minimax algorithm with alpha-beta pruning. Since the state space of the game is pretty big (almost as big as in the chess game) it cannot be traversed completely to a terminal state, but instead only the first 4 levels of the decision tree are generated. The board at the 4th("terminal") level is evaluated using the following heuristics:

  • Number of discs - the bigger the number of discs on the board a player owns, the better.
  • Mobility - the fewer moves the opponent of the current player has, the better
  • Location - some position are better than others, because they offer a better chance for attacks
  • Turn skip - sometimes the player cannot make a valid move, which is very profitable for the other player.
  • Number of stable discs - some discs on the board cannot be flipped anymore, either because they are surrounded from all sides, or because they are located in the corners of the board. The more such discs a player owns, the better for him.

Further improvement

There are a few points that I'd like to have improved/developed in the near feature. These include, but are not limited to:

  • Adjust the weights, given to the different heuristics, perhaps by using a neuron net
  • Port the game to Android
  • Allow for multiplayer games

About the author

Author: Martin Asenov Asenov
email: asenov.m@gmail.com

About

Implementation of the Reversi/Othello game, written in Java and Swing and featuring an AI opponent

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages