Skip to content

Instantly share code, notes, and snippets.

@ramirez7
Created April 25, 2014 23:04
Show Gist options
  • Select an option

  • Save ramirez7/11306110 to your computer and use it in GitHub Desktop.

Select an option

Save ramirez7/11306110 to your computer and use it in GitHub Desktop.
#!/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