Created
April 25, 2014 23:04
-
-
Save ramirez7/11306110 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
| #!/usr/bin/expect | |
| #example state: | |
| #-------------------X-------XX------XO--------------------------- O | |
| if { $argc != 2 } { | |
| puts "USAGE: ./go.exp <BOARD> <PLAYER>" | |
| exit 1 | |
| } | |
| log_user 0 | |
| #Linux executable | |
| spawn lEdax-x64 | |
| expect ">" | |
| send "setboard [lindex $argv 0] [lindex $argv 1]\n" | |
| send "go\n" | |
| expect "Edax plays *" | |
| regexp {([A-H][1-8])} $expect_out(buffer) _ out | |
| puts $out | |
| exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment