179
$\begingroup$

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;
}
$\endgroup$
  • 80
    $\begingroup$ With the new site icon and the introduction to the post, I thought I'm on Workplace. $\endgroup$ – Tomáš Zato May 20 '16 at 8:34
  • 13
    $\begingroup$ Wait! You ran untrusted code even though you didn't know what it did, on your machine!? $\endgroup$ – SnakeDoc May 20 '16 at 21:40
  • 2
    $\begingroup$ @SnakeDoc We've been through this... ;P $\endgroup$ – Khale_Kitha May 21 '16 at 3:18
  • 3
    $\begingroup$ @TomášZato I actually I was on Workplace until I saw your comment. $\endgroup$ – Derek 朕會功夫 May 21 '16 at 7:29
  • 3
    $\begingroup$ @SnakeDoc It's obvious that it doesn't do anything bad, (no undefined behaviour, no file I/O, etc.) but it's not obvious what it does do. $\endgroup$ – wizzwizz4 May 21 '16 at 8:19
172
$\begingroup$

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.

$\endgroup$
  • 34
    $\begingroup$ For the fun of it you might want to put the link to the youtube video instead of your guess...you know, so people understand it better, not for any other reason :) $\endgroup$ – Marius May 20 '16 at 6:24
  • 75
    $\begingroup$ Wow - you know the rules, and so do I $\endgroup$ – Jonathan Allan May 20 '16 at 6:27
  • 6
    $\begingroup$ @Marius He did nothing, but the GEMA blocks pretty much every music video on youtube. $\endgroup$ – sandbo00 May 20 '16 at 6:33
  • 5
    $\begingroup$ @warspyking Remember that we are on puzzling here, so I don't think that this background story actually happened ;-) $\endgroup$ – sandbo00 May 20 '16 at 9:21
  • 21
    $\begingroup$ @saluce Ewe.spin(this, Directions.Right) {Baby();} Math.Round(Directions.Right); struct Baby {}; Math.Round(Math.Round(Math.Round(Directions.Right))); $\endgroup$ – immibis May 21 '16 at 6:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.