Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Fundamentals
- {
- class Program
- {
- static void Main(string[] args)
- {
- while (true)
- {
- string planet = Console.ReadLine();
- string command = Console.ReadLine();
- List<int> myList = new List<int>();
- string[] split = new string[command.Length / 2 + (command.Length % 2 == 0 ? 0 : 1)];
- for (int i = 0; i < split.Length; i++)
- {
- split[i] = command.Substring(i * 2, i * 2 + 2 > command.Length ? 1 : 2);
- }
- foreach (var item in split)
- {
- int a = int.Parse(item);
- myList.Add(a);
- }
- if (myList[0] == 71 && myList[1] == 79)
- {
- Console.WriteLine("GO HOME");
- Console.WriteLine("Going home.");
- break;
- }
- else
- {
- foreach (var item in split)
- {
- int a = int.Parse(item);
- Console.Write((char)a);
- }
- Console.WriteLine();
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment