I found a problem that I can't solve, in an online course. I need to script it in Ruby, but every time I arrive to the last part, I can't script it right.
This is the problem: (Ruby)
Write a "Deaf Grandma" program. Whatever you say to grandma (whatever you write to the program), she should respond with an 'EH ?! UP THE VOICE, CHILD!' Unless you shouted it (written in capital letters). If you shout then she can hear you (or so she thinks) and then she answers you 'NO, NOT FROM 1938 !' To make this program really believable, make sure that your grandmother shouts a different year all the time; maybe a random number between 1930 and 1950. You can't stop talking to your grandmother until you cry 'BYE'. Tip: Don't forget about chomp! 'BYE' with an Enter is not the same as a 'BYE' without! Tip 2: Try first to think about which parts of your program will have to repeat themselves again and again. All these parts will have to be in your while loop.
Thanks For Helping!
Aucun commentaire:
Enregistrer un commentaire