-
-
Save kurain/1094764 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
use strict; | |
use warnings; | |
use AnyEvent; | |
use AnyEvent::HTTPD; | |
use AnyEvent::Util qw(run_cmd); | |
use Cwd; | |
my $httpd = AnyEvent::HTTPD->new (port => 9090); | |
my $last_pid = undef; | |
my $last_cv = undef; | |
$httpd->reg_cb ( | |
'/run' => sub { | |
my ($httpd, $req) = @_; | |
run_cmd [ | |
"/Users/yohei/working/gai/tools/playgame.py", | |
"--end_wait=0.25", | |
"--verbose", | |
"--log_dir", "game_logs", | |
"--turns", "1000", | |
"--map_file", "/Users/yohei/working/gai/tools/maps/symmetric_maps/symmetric_40.map", | |
"--log_error", | |
"-e", | |
"ruby /Users/yohei/working/gai/bot_ruby/MyBot.rb", | |
"python /Users/yohei/working/gai/tools/sample_bots/python/GreedyBot.py", | |
"python /Users/yohei/working/gai/tools/sample_bots/python/GreedyBot.py", | |
"python /Users/yohei/working/gai/tools/sample_bots/python/GreedyBot.py", | |
"python /Users/yohei/working/gai/tools/sample_bots/python/GreedyBot.py", | |
]; | |
}, | |
); | |
warn 'starting server at localhost:9090'; | |
$httpd->run |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment