Advertisement
Guest User

Untitled

a guest
Aug 18th, 2019
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. namespace exercise8
  2. {
  3. class Program
  4. {
  5. static void Main(string[] args)
  6. {
  7. string[] wordList = new string[] {"baloon, toothbrush, telephone, grandma, homework, codelex, spider"};
  8. Random rng = new Random();
  9. int rngWord = rng.Next(0, wordList.Length);
  10. char[] word = wordList[rngWord].ToCharArray();
  11.  
  12. Console.WriteLine(wordList[rngWord]);
  13.  
  14. foreach (char c in word)
  15. {
  16. Console.WriteLine(c);
  17. }
  18.  
  19. Console.ReadLine();
  20.  
  21.  
  22. }
  23. }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement