Reversi (AKA Othello) Module Complete

Inspired by the discussion HERE, I made a module for creating any size Reversi board and an extensive demo showing how to use it. 

Note: The module does NOT rely on SSK, but the demo does.

Note 2: This module is not based on the discussion noted above.  It is entirely new code written by myself.  

It is coming to the marketplace soon and is available now fromSellfy.

If you have and Android device you can play the demo to check it out: 

https://github.com/roaminggamer/RG_FreeStuff/raw/master/Demos/Reversi.apk

https://www.youtube.com/watch?v=I10Sjf2Wzzk&feature=youtu.be

@roaminggamer, Just out of interest how did you implement the computer AI?  I was looking into the best ways of doing it and everything was pointing towards using the minimax algorithm and alpha/beta pruning - which I kind of understand, but would have no clue at all how to begin implementing it.

The use of the term AI quite generous when applied to my approach.

Essentially I did this before each player’s ‘turn’:

  1. Scan board for current player’s pieces.

  2. Using those pieces, scan for all legal moves. 

  - During this scan, count the number of opponent chips that will be flipped/swapped.

  - Mark legal cells with the swap count.  (Look at video.  See those counts?  That is the easy/medium mode showing the value of a move.)

  1. Accumulate list of legal moves for current player this round and return it. 

  - This is a list of empty cells that can be ‘clicked’.

  - List is sorted from most flips/swaps to fewest.

Then, if the computer is playing, use this logic:

  • Dumb AI - Choose lowest value move.
  • Smart AI - Choose highest value move.
  • Medium AI - Choose random move.

In point-of-fact, to be truly intelligent, the move algorithm would need some strategic parts:

  • Corner capturing emphasis.
  • Multi-turn advance planning and evaluation
  • Blocking
  • etc.

For anyone thinking about getting my module, not happy with the AI please note you can find free online Reversi AI algorithms and convert them to Lua.

Then, each turn you can:

  1. Extract the board layout using the modules built-in get function.

  2. Convert that layout to a format suitable for consumption by the AI code.

  3. Run the AI code.

  4. Apply the ‘winning move’ just as I do, but not resulting from your far superior AI code.
     

My module is less about AI and more about a flexible board layout and play mechanism.

Note: I must be time travelling.  :)   

As I type this, the post by @Appletreeman says it was posted 

Today 12:34 AM

My answers are:

Today 10:27 AM and Today 10:33 AM

This game is right up my alley. Perfect. Thank you!

Interesting!

Maybe you can create the new Alpha Zero. I watched the Alpha Go documentary. Super interesting stuff.

I have by the way sent you a mail about a new boardgame AI  :wink:

@roaminggamer, Just out of interest how did you implement the computer AI?  I was looking into the best ways of doing it and everything was pointing towards using the minimax algorithm and alpha/beta pruning - which I kind of understand, but would have no clue at all how to begin implementing it.

The use of the term AI quite generous when applied to my approach.

Essentially I did this before each player’s ‘turn’:

  1. Scan board for current player’s pieces.

  2. Using those pieces, scan for all legal moves. 

  - During this scan, count the number of opponent chips that will be flipped/swapped.

  - Mark legal cells with the swap count.  (Look at video.  See those counts?  That is the easy/medium mode showing the value of a move.)

  1. Accumulate list of legal moves for current player this round and return it. 

  - This is a list of empty cells that can be ‘clicked’.

  - List is sorted from most flips/swaps to fewest.

Then, if the computer is playing, use this logic:

  • Dumb AI - Choose lowest value move.
  • Smart AI - Choose highest value move.
  • Medium AI - Choose random move.

In point-of-fact, to be truly intelligent, the move algorithm would need some strategic parts:

  • Corner capturing emphasis.
  • Multi-turn advance planning and evaluation
  • Blocking
  • etc.

For anyone thinking about getting my module, not happy with the AI please note you can find free online Reversi AI algorithms and convert them to Lua.

Then, each turn you can:

  1. Extract the board layout using the modules built-in get function.

  2. Convert that layout to a format suitable for consumption by the AI code.

  3. Run the AI code.

  4. Apply the ‘winning move’ just as I do, but not resulting from your far superior AI code.
     

My module is less about AI and more about a flexible board layout and play mechanism.

Note: I must be time travelling.  :)   

As I type this, the post by @Appletreeman says it was posted 

Today 12:34 AM

My answers are:

Today 10:27 AM and Today 10:33 AM

This game is right up my alley. Perfect. Thank you!

Interesting!

Maybe you can create the new Alpha Zero. I watched the Alpha Go documentary. Super interesting stuff.

I have by the way sent you a mail about a new boardgame AI  :wink: