Hi everybody. A new problem: in my script slave can repeat an exercise with the opportunity to ask for mercy.
BUT mistress can say no and then slave must continue the same routine without any button to ask....
My code doesn't work....why?
Code:
//EXERCISE NO MERCY
def exercisenomercy = {
........
}
//-------------------------------------------
//EXERCISE WITH MERCY
def exerciseyesmercy = {
........
def tempo = getRandom(2)+3
def time = showButton("Please stop!", tempo)
}
//-------------------------------------------
//MISTRESS DECISION
def decision = {
def yesno = getRandom(2)
switch (yesno) {
case 0: def mercy = 1
default: def mercy = 0
}
//-------------------------------------------
(1..10).each {
switch (mercy) {
case 0: exerciseyesmercy()
default: exercisenomercy()
}
//-------------------------------------------