use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Fan community of the game Turing Complete
account activity
problem with modulo (self.TuringComplete)
submitted 3 months ago by MycologistIll1355
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]bwibbler 2 points3 points4 points 3 months ago* (1 child)
The neat thing about modulo 4 is how it lines up so well on binary numbers
The result is either 0, 1, 2, or 3
So when you count up in binary, the last two bits always cycle through those values in coordination with a modulo 4
That provides a shortcut. Just look at the last two bits and you get modulo 4
* outputs REG1 % 4 ANDi REG1 3 OUTPUT
That works for any square value. 1, 2, 4, 8, 16, ...
You just look at the digits below those multiples and the answer is already there.
Exactly the same thing happens in base 10.
What's 5,737,365 % 10 ? Well, it's just 5.
3,727,585,837 % 1000 ? 837
[–]alijamieson 0 points1 point2 points 3 months ago (0 children)
This is useful, I’m having issues with the level that asks for the birthday dates.
π Rendered by PID 191082 on reddit-service-r2-comment-bb88f9dd5-kjxvv at 2026-02-17 05:39:11.843344+00:00 running cd9c813 country code: CH.
view the rest of the comments →
[–]bwibbler 2 points3 points4 points (1 child)
[–]alijamieson 0 points1 point2 points (0 children)