Created
January 22, 2012 15:42
-
-
Save ptn/1657482 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env ruby | |
require 'irb' | |
dir = File.expand_path("~/.draughts/") | |
unless File.directory? dir | |
print "LOG: ~/.draughts dir does not exist, creating..." | |
Dir.mkdir dir | |
puts "done." | |
end | |
db = File.expand_path("~/.draughts/draughts.db") | |
unless File.exists? db | |
print "LOG: Database not in directory, copying..." | |
sample = File.expand_path("examples/draughts.db.example") | |
target = File.expand_path("~/.draughts/draughts.db") | |
require 'fileutils' | |
FileUtils.cp(sample, target) | |
puts "done." | |
end | |
IRB.setup nil | |
puts "LOG: Loading modules..." | |
IRB.load_modules << "./lib/draughts.rb" | |
IRB.load_modules << "./lib/draughts/ai/setup.rb" | |
IRB.load_modules << "./lib/draughts/ai/training_bot.rb" | |
puts "LOG: Start!" | |
IRB.start |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment