Skip to content

Instantly share code, notes, and snippets.

@ptn
Created January 30, 2012 08:42
Show Gist options
  • Save ptn/1703380 to your computer and use it in GitHub Desktop.
Save ptn/1703380 to your computer and use it in GitHub Desktop.
# Run from bin/testbot
Draughts::AI::Board.each do |b|
Draughts::AI::Move.each do |m|
['black', 'white'].each do |c|
p = Draughts::AI::Play.first(board: b, move: m, color: c)
if p
result = p.legal
Draughts::AI::Play.all(board: b, move: m, color: c).destroy
Draughts::AI::Play.create(board: b, move: m, color: c, legal: result)
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment