Advertisement
Guest User

Untitled

a guest
Nov 22nd, 2019
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace Snake
  8. {
  9. public static class Menu
  10. {
  11. public static void DrawMenu(IReadOnlyList<string> menuItems, int index)
  12. {
  13. for(int i = 0; i < menuItems.Count; i++)
  14. {
  15. if (i == index)
  16. {
  17. Console.BackgroundColor = ConsoleColor.Gray;
  18. Console.ForegroundColor = ConsoleColor.Black;
  19. Console.WriteLine(menuItems[i]);
  20. }
  21. else
  22. {
  23. Console.WriteLine(menuItems[i]);
  24. }
  25. Console.ResetColor();
  26. }
  27. }
  28.  
  29.  
  30. }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement