I want to know if there is a simple method to do number equations in a limited number space like 0 and 40 or 0 and 1000? Even better if there is a way for a numbers to go back. For example, have a number space between 0 and 8. Then do operation 4 + 7 which would be equal to 11(over 8) and then this number will go back to 5, because 4 + 4 would be 8 and because there is still a residue of 3(7 – 4 = 3) which then equal to 8 – 3 which is 5. And vice versa with substraction where 3 – 4 would be equal to 1 in a 0 to 8 number space.
I tried to do bunch of ifs, but stopped, because it made code a little bit complicated.