Skip to content

Instantly share code, notes, and snippets.

@rightfold

rightfold/.e Secret

Last active September 16, 2015 21:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rightfold/58a472a4cead5db9995f to your computer and use it in GitHub Desktop.
Save rightfold/58a472a4cead5db9995f to your computer and use it in GitHub Desktop.
class
MARBLES
creation {PLAYER}
make
feature {NONE}
make
do
count := 100
end
feature {ANY}
count: INTEGER
feature {PLAYER}
lose(n: INTEGER)
require
enough_count: n <= count
do
count := count - n
end
win(n: INTEGER)
do
count := count + n
end
invariant
positive_count: count >= 0
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment