Paul's puzzle 42 solution - 36 parts


#1

Here’s my solution (it’s the one in the book):

And here’s the link:

http://www.lodev.org/jstumble/?board=00rrrre0l0eerrrree0l0eerrrree0l0lerrrleerxlfixf

Description: The solution adds one to each register in turn, starting with the right register. If the right register overflows first (i.e., it goes over 15), then a red ball goes in the basket. If the left register overflows first, a blue ball goes into the basket.

For example:

Starting register values:
A: 12
B: 13

After 1 red and 1 blue ball:
A: 13
B: 14

After 2 red and 2 blue balls:
A: 14
B: 15

After 3 red and 3 blue balls:
A: 15
B: overflow (red ball in basket, indicating that A was not greater than B)


#2

You seem to be missing three ramps, two on the right and one at the bottom.


#3

Thanks, menderbug! I fixed it.


#4

Image is better now (the ramp up-right from the top crossover is facing the wrong way) but the link is still to the version described in menderbug’s post.


#5

What is the advantage of making this comparison by increasing each register by one each cycle until overflow rather than decreasing each until one hits zero?