• 0 Posts
  • 10 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
    


  • My hypothesis is that they hide. So I saturate all the hiding places so they have nowhere left to hide.

    When I buy something known for liking to hide, I buy N of them and place them all in a designated “I’ve got N of these things” place (P). Then I put 1 in its home. When it hides, I get its replacement. When that hides, same again. When there are none left in P, I buy N more. Eventually they have nowhere left to hide and finding one is easy. Consequently, they stop hiding.


  • jaupsinluggies@feddit.uktoMemes@lemmy.mlSoon
    link
    fedilink
    arrow-up
    2
    ·
    30 days ago

    Maybe it’d be a good idea to use a word other than death, which is clearly being misinterpreted to mean killing people. “Dissolution of [x]” obviously isn’t as snappy, but it’s an improvement at least in terms of accuracy of intent.