Skip to content

Instantly share code, notes, and snippets.

@zachpendleton
Last active July 26, 2016 15:41
Show Gist options
  • Select an option

  • Save zachpendleton/9a2d30507b1ae19c8b863fa005e18814 to your computer and use it in GitHub Desktop.

Select an option

Save zachpendleton/9a2d30507b1ae19c8b863fa005e18814 to your computer and use it in GitHub Desktop.
require "json"
$stdin.sync = true
$stdout.sync = true
loop do
game_state = JSON.parse(gets)
row_height = game_state["board"].length
column_width = game_state["board"][0].length
if game_state["winner"]
break
end
puts rand(column_width)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment