using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Ejercicio_2
{
class Program
{
enum direcion { arriba=1,abajo=3,derecha=2,izquieda=4};
static void Main(string[] args)
{
string num = "";
Console.WriteLine("Escribe la direcion que desees tomar");
num = Console.ReadLine();
for (int i = 0; i < num.Length; i++)
{
Console.WriteLine("{0}", num.Substring(i, 1));
}
}
}
}
Hello my problem is the following, the statement of the exercise says that we have a drone that can go up down right left. That we associate an entire value to each enum. Enter the numbers (1,2,3,4) on the keyboard and show us on the top right below. The problem is that I put up in the initialization of the enums a number for example above = 1 and then if I enter by keyboard 1 does not come up, it shows me 1. I do not know how I can do it. I had thought about saving what you put in a chain like in the example and then buying character by character and if it is a 1 that shows up, if it is 2 that shows right, etc. But I do not know how to compare the characters of the chains. But the question would be using the enums, because the exercise tries to practice with them.