Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
README.md
game.rb
player.rb
q_learning_player.rb
run-q.rb
run.rb

README.md

Example of reinforcement learning using q-learning to teach an AI to play a game in Ruby

This example will show how we can teach an AI to play a simple game using the Q-learning reinforcement learning algorithm.

This is implemented in pure Ruby without any external dependencies.

To run the game and play a human run:

$ ruby run.rb

To run the game and let the AI play run:

$ ruby run-q.rb

For more information about how this is implemented see Teaching an AI to play a simple game using q-learning.