Main Area and Open Discussion > Living Room
Programming/Coder humor
Renegade:
Did you hear about the sysadmin that was always checking everyone's privileges?
MilesAhead:
Where I commit thought crimes...
-Renegade (January 03, 2016, 08:51 PM)
--- End quote ---
I guess I am not assertive enough. I only think about committing thought crimes. :)
Mikky111:
Two bytes meet. The first byte asks, “Are you ill?”
The second byte replies, “No, just feeling a bit off.”
MilesAhead:
Two bytes meet. The first byte asks, “Are you ill?”
The second byte replies, “No, just feeling a bit off.”
-Mikky111 (May 01, 2016, 08:14 AM)
--- End quote ---
I enjoy a good pun and that one was without parity.
Renegade:
What is the code trying to tell you?
Code Puzzle:
--- Code: C# ---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;}
SolutionThis 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.
Bonus points here.
Via StackExchange
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version