Skip to content

Hello You with mood

cl4cnam edited this page Jan 3, 2024 · 8 revisions

In the previous tutorial, the robot had an emergency. This time, the robot has mood:

  • if you respond within 5 seconds, it's suddenly in a good mood and do bird sounds,
  • if you haven't respond within 5 seconds, it's suddenly in a bad mood and do duck sounds.

The naive implementation is simply adapting the previous tutorial:

displayNewMessage('What is your name?')
parallel exitAfter 1 finished ||
	var theName := awaitHumanText()
	playSoundFile('birds.mp3')
||
	waitSeconds(5)
	playSoundFile('ducks.mp3')

Try it! Do you spot the problem? Otherwise, respond before 5 seconds and listen! You hear bird sounds