to flipgame
 local "score

 make "score 0

 repeat 3 [coinflip]
end

to coinflip
 local "guess
 local "flip

 make "guess 0  ; It's not necessary to assign values to guess and flip,
 make "flip 0   ; but it doesn't hurt.

 print [I'm going to flip a coin.  Can you guess the outcome?]
 print [Enter 0 for tails or 1 for heads.]
 make "guess readword
 print (sentence [You guessed] :guess [I flipped:])
 make "flip random 2
 print :flip
 if equalp :guess :flip [print [You win!] make "score :score +1]
 print [Your score is:]
 print :score

end