Advertisement
akosiraff

Gibberish

Nov 20th, 2018
262
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.53 KB | None | 0 0
  1.  
  2. Download: https://solutionzip.com/downloads/gibberish/
  3. We are going to create some simple rules for translating normal English into Gibberish. A common
  4. rule is to add sounds to each syllable, but since syllables are difficult to detect in a simple program,
  5. we’ll use a rule of thumb: every vowel denotes a new syllable. Since we are adding a Gibberish
  6. syllable to each syllable in the original words, we must look for the vowels.
  7. To make things more unique, we will have two different Gibberish syllables to add. The first Gibberish
  8. syllable will be added to the first syllable in every word, and a second Gibberish syllable will be added
  9. to each additional syllable. For example, if our two Gibberish syllables were “ib” and “ag”, the word
  10. “program” would translate to “pribogragam.”
  11. In some versions of Gibberish, the added syllable depends on the vowels in a word. For example, if we
  12. specify “*b” that means we use the vowel in the word as part of the syllable: e.g. “dog” would become
  13. “dobog” (inserting “ob” where the “*” is replaced by the vowel “o”) and “cat” would become “cabat”
  14. (inserting “ab” where “a” is used). Note that the “*” can only appear at the beginning of the syllable
  15. (to make your programming easier).
  16. After the Gibberish syllables are specified, prompt the user for the word to translate. As you process
  17. the word, make sure you keep track of two things. First, if the current letter is a vowel, add a Gibberish
  18. syllable only if the previous letter was not also a vowel. This rule allows us to approximate syllables:
  19. translating “weird” with the Gibberish syllable “ib” should become “wibeird”, not “wibeibird”.
  20. Second, if we’ve already added a Gibberish syllable to the current word, add the secondary syllable to
  21. the remaining vowels. How can you use Booleans to handle these rules?
  22. Finally, print the Gibberish word. Afterwards, ask the user if they want to play again, and make sure
  23. their response is an acceptable answer (“yes”/“no”, “y”/“n”). Make sure to check the validity for all of
  24. your user inputs throughout the program. Don’t let bad input create errors.
  25. Your program will:
  26. 1. Print a message explaining the game.
  27. 2. Prompt for two Gibberish syllables (indicate the allowed wildcard character “*”).
  28. 3. Prompt for a word to translate.
  29. 4. Process the word and add the syllables where appropriate.
  30. 5. Print the final word, and ask if the user wants to play again
  31. Download: https://solutionzip.com/downloads/gibberish/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement