Warning: DateTime::createFromFormat(): Invalid date.timezone value '-7', we selected the timezone 'UTC' for now. in /var/www/vhosts/scitoys.com/httpdocs/vendor/symfony/http-foundation/ResponseHeaderBag.php on line 336 Puzzles and Adventures with Functions | Science Toys
Skip to main content
Puzzles and Adventures with Functions
The Slow SOS program takes a long time to spell out SOS. How would you change it to go four times faster?
Can you make the Nano spell out your name in Morse code? You can look up the Morse code chart on the Internet to see how to form each letter of the alphabet using dots and dashes.
Our Slow SOS program delays 2000 milliseconds (two seconds) between each SOS. But in real Morse code, the delay between words should be seven times as long as a dot. Can you make our program conform to international standards?
Our Slow Morse program uses enumeration types (enum) to define the constants we use for the pauses. We use the simplest possible form of enumeration type. If you want to see all the possibilities, you can look up enum on the C++ Reference Manual. The language in the manual is very precise, and may be a little daunting to read, since it tries to cover every part of the definition, much like an unabridged dictionary. But when you need to know something particular about the language, there is no substitute for the detail in the Reference Manual.