Skip to content

Instantly share code, notes, and snippets.

@SoxFace
Forked from epoch/grandma.md
Last active August 29, 2015 14:13
Show Gist options
  • Save SoxFace/a45030cc9d01b6f53486 to your computer and use it in GitHub Desktop.
Save SoxFace/a45030cc9d01b6f53486 to your computer and use it in GitHub Desktop.

Grandma

Write a Deaf Grandma program.

Whatever you say to grandma (whatever you type in), she should respond with

HUH?! SPEAK UP, SONNY!

unless you shout it (type in all capitals).

If you shout, she can hear you (or at least she thinks so) and yells back

NO, NOT SINCE 1938!

To make your program really believable, have grandma shout a different year each time; maybe any year at random between 1930 and 1950.

You can't stop talking to grandma until you shout BYE.

Extensions

  1. What if grandma doesn't want you to leave? When you shout BYE, she could pretend not to hear you. Change your previous program so that you have to shout BYE three times in a row. Make sure to test your program: if you shout BYE three times, but not in a row, you should still be talking to grandma.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment