Skip to content

AgileMantis/minimax_algorithm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

minimax_algorithm

Minimax algorithm implemented via a Tic-Tac-Toe variant using a 6x6 grid where 4 in a row wins.

See ledsworth.com for more details about the algorithm and a live/playable version.

Running the game

Below is how I spawn/run a game from within IRB. It's not user friendly....But it works.

load "./tic_tac_toe_variant.rb"  
game=TicTacToeVariant::Game.new(true)

You can them call game.make_move %sq% to get started (e.g. game.make_move 0).

The key is knowing the squares, 0 for upper left, 35 for lower right.

The algorithm will play it's move and then display of the board state. You can then make your next move.

About

Minimax algorithm (via a Tic-Tac-Toe variant)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages