Skip to content

Instantly share code, notes, and snippets.

@jaredpar
Created December 13, 2019 17:48
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jaredpar/a0835afc71139284c09bfda203d8c011 to your computer and use it in GitHub Desktop.
Save jaredpar/a0835afc71139284c09bfda203d8c011 to your computer and use it in GitHub Desktop.
using System;
static class Program
{
static void Main(string[] args)
{
bool b = GetTricksyBool();
if (b) Console.WriteLine(b.IsTrue());
}
static bool IsTrue(this bool b)
{
bool bTrue = true;
bool bFalse = false;;
if (b == bTrue)
{
return true;
}
else if (b == bFalse)
{
return false;
}
else
{
return !true && !false;
}
}
static unsafe bool GetTricksyBool()
{
bool b = true;
byte* p = (byte*)(&b);
*p = 2;
return b;
}
}
@JYCabello
Copy link

I want to print this and hang it from the office wall.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment