Advertisement
KillianMills

Piratespeak.java

Nov 19th, 2014
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.23 KB | None | 0 0
  1. //another ancient piece of code, 2011.
  2.  
  3. public class PirateSpeak
  4. {  
  5.     public static void main(String [] args)
  6.     {
  7.  
  8.     String [] english = { "hello" , "hi" , "pardon me" , "excuse me" , "my" , "friend" , "sir" , "madam" , "miss" , "stranger" , "where" , "is" , "the" , "you" , "tell" , "know" , "how far" , "old" , "attractive" , "happy" , "nearby" , "restroom" , "resturant" , "hotel" , "pub" , "bank" };
  9.  
  10.     String [] pirate = { "ahoy" , "yo-ho-ho" , "avast" , "arrr" , "me" , "me bucko" , "matey" , "proud beauty" , "comely wench" , "scuvy dog" , "whar" , "be" , "th" , "ye" , "be tellin'" , "be knowin'" , "how many leagues" , "barnacle-covered" , "comely" , "grog-filled" , "broadside" , "head" , "galley" , "fleabag inn" , "Skull & Scuppers" , "buried treasure" };
  11.  
  12.     System.out.println("Type to translate from English to Pirate: " );
  13.  
  14.     int i;
  15.  
  16.     String translate = Console.readToken();
  17.     while(translate != null)
  18.         {      
  19.             for(i=0; i< english.length; i++)
  20.             {
  21.                 if(translate.equals(english[i]))
  22.                 {
  23.                     System.out.print(pirate[i] + " ");
  24.                 }
  25.             }
  26.         translate = Console.readToken();
  27.    
  28.         }
  29.     }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement