karel
karel copied to clipboard
AddFast 2.4.3
Hi! I have a feeling that when solving the AddFast level, the last carry bit or the entire most-significant bit is forgotten during addition.
the last carry bit or the entire most-significant bit is forgotten
That was a deliberate decision to sensitize my students to "integer overflow"; the sum of 2 n-bit numbers may not fit into n bits.
Most mainstream programming languages suffer from this as well. For example, 1 billion plus 2 billion is -1294967296 in Java.
Hey! So there is no right Answer in this level ?
Depends on what you mean by "right answer". In byte arithmetic, 255+1 = 0