212

Well this is strange.

I forgot to lock my monitor when I walked away from my desk, at work, and one of my co-workers decided to have a little fun.

When I got back, I found this little C# console app code segment, sitting forefront on my machine. I ran it a few times, but the results don't really tell me anything.

Does anyone else know what this could mean??

void Main()
{ 
  GetEwe();
  Console.WriteLine($"You have been given: {Ewe}");  
}

public enum Directions { Up, Down, Left, Right, Forward, Backward, Diagonally };
public Directions? Ewe;

public Directions GetEwe()
{
  Random rand = new Random(DateTime.Now.Millisecond);
  do
  {
    Ewe = 
    (
      from direction in Enum.GetValues(typeof(Directions)).OfType<Directions>()
      //let u = Directions.Down     
      select direction
    ).ElementAt(rand.Next(0, Enum.GetNames(typeof(Directions)).Length));
  }
  while (Ewe == Directions.Up);
  return Ewe.Value;  Around();
}

private void Around()
{
  Ewe = null;
}
Hazel へいぜる
  • 10,581
  • 15
  • 74
Khale_Kitha
  • 8,442
  • 3
  • 28
  • 60

1 Answers1

198

I guess this is

A rickroll

Because

This code is never going to give you (Ewe) up, because the loop will assign a random direction to ewe as long as it is up
It is never going to let you (u) down, because the line//let u = Directions.Down is just a comment.
Since the return statement happens before calling Around(), it is obviously never going to run around.
And, because the method Around() is never called, it is also never going to "desert you", because it will never assign a null-value to Ewe.

Khale_Kitha
  • 8,442
  • 3
  • 28
  • 60
sandbo00
  • 1,576
  • 1
  • 10
  • 10