Skip to content

Instantly share code, notes, and snippets.

@christianromney
Created October 26, 2017 14:21
Show Gist options
  • Save christianromney/f557c2454fed3221e38fb6bb9c7943ff to your computer and use it in GitHub Desktop.
Save christianromney/f557c2454fed3221e38fb6bb9c7943ff to your computer and use it in GitHub Desktop.
require './amb.rb'
$reported = false
def report(a, b)
puts "a: #{a}, b: #{b}"
unless $reported
puts "Press any key to continue..."
gets
$reported = true
end
end
begin
a = amb 1, 2, 3, 4, 5 # pick one of these numbers
b = amb 1, 2, 3, 4, 5 # pick one of these numbers
report a, b unless $reported
# lets make assertions about a and b
assert! a > 2
assert! a < b
assert! b.odd?
# lets print a and b again
report a, b
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment