Pig Latin

Pig Latin is a language game where you alter the English words. The goal is to conceal the meaning of the words from others not familiar with the rules (like you're talking in code or a secret language). The reference to Latin is a misnomer, because it has nothing to do with Latin. It'is simply a form of jargon, used only because it turns your English words into a strange and foreign-sounding language.

According to John R. Hailman's Thomas Jefferson on Wine, Thomas Jefferson used pig latin as a kid. This is one of the earliest known uses of pig latin.

 

For words that begin with consonant sounds, the initial consonant or consonant cluster is moved to the end of the word, and "ay" (some people just add "a") is added, as in the following examples:

  • "pig" → "igpay"
  • "banana" → "ananabay"
  • "trash" → "ashtray"
  • "happy" → "appyhay"
  • "duck" → "uckday"
  • "glove" → "oveglay"

For words which begin with vowel sounds or silent letter, one just adds "yay" to the end. Examples are:

  • "eat" → "eatyay"
  • "omelet" → "omeletyay"
  • "are" → "areyay"

  

Now that you know pig latin, let's program some in Small Basic!

 

While ("True")

   TextWindow.Write("Enter a word: ")

   word = TextWindow.Read()

   pigLatin = Text.GetSubTextToEnd(word, 2) 

   pigLatin = pigLatin + Text.GetSubText(word, 1, 1)

   pigLatin = pigLatin + "ay"                   

   TextWindow.WriteLine(pigLatin)                   

   TextWindow.WriteLine("") 

EndWhile

Do you have any questions? Ask us! We're full of answers and other fine things!

Head to the Small Basic forum to get the most answers to your questions: 

https://social.msdn.microsoft.com/Forums/en-US/smallbasic/threads/   

And go to https://blogs.msdn.com/SmallBasic to download Small Basic and learn all about it!

   

Small and Basically yours

- Ninja Ed