// ...
html.html { head { title 'Think of a Number' }
body {
h1 'Think of a Number'
if (goal && guess) {
div "Your guess is $guess "
if (guess == goal) {
div 'correct!'
} else if (guess < goal) {
div 'too low'
} else {
div 'too high'
}
}
p "What's your guess (0..100)?"
form(action : 'HighLow.groovy') {
input (type : 'text', name : 'guess', '')
button (type : 'submit', 'Guess')
button (type : 'submit', name : 'restart', value : 'true', 'New Game')
}
}
}