• 0 Posts
  • 60 Comments
Joined 2 months ago
cake
Cake day: June 6th, 2025

help-circle














  • This works for both positive and negative numbers:

    private static bool isEven(int number)
    {
    	bool result = true;
    
    	while (number < 0)
    	{
    		number = number - 1;
    		if (result == true)
    			result = false;
    		else
    			result = true;
    	}
    	while (number > 0)
    	{
    		number = number - 1;
    		if (result == true)
    			result = false;
    		else
    			result = true;
    	}
    	return result;
    }
    

    Output:

    isEven(4) = True
    isEven(5) = False
    isEven(-4) = True
    isEven(-5) = False
    

  • They do work. It takes some practice to get them though. At first I used a pencil or something to focus on while I made the two dots merge together, stayed focussed on the pencil until my brain “saw” the image behind it, then it sort of locked in and I could take the pencil away. I’ve done so many of them now that I can just go crosseyed to bring the dots together, then look at the middle picture.

    The 3D image works by tricking your brain into seeing a third image that isn’t really there. We’re used to constructing 3D images from two slightly different views; we do it all the time, so the two images are slightly different and when overlaid use the same mechanism to make you think it’s 3D.