Re:Show HN: CPU simulator in 60 lines of code
by mtdewcmu on Wednesday October 14, 2015 @08:25PM
(#10390515)
I would make that series of if-statements more obviously deterministic, for starters. One way of accomplishing that would be a bunch of nested if-else blocks. However, that would be ugly. I'd prefer something like continue statements -- which would necessitate redesigning the loop to avoid bypassing the code at the bottom. Either way, the way this currently gives the appearance of being possibly nondeterministic makes me uncomfortable... and besides, executing those extra conditionals wastes CPU cycles.
[ Parent
| on HN ]
There are no comments on this comment yet.