[Shootout-list] dispatch bug?

Brian Hurt bhurt at spnz.org
Sat Aug 20 21:00:27 UTC 2005


I had some spare time, and noticed that there were a couple of tests not 
implemented in Ocaml.  So I decided to implement dispatch.  I have code 
working, but I'm not getting the right checksum.  The web page says that 
for N=10, the checksum should be 450, I'm getting like 1200.

Looking at the problem, I think I may have found a bug in the code for the 
dispatch test.  In both the C# and the D code, the next state after 
PressurizedUnsealed is Sealed, not PressurizedSealed.  So instead of the 
cycle being:

   +-----------------------------------------------------------+
   |                                                           |
   V                                                           |
UnpressEmpty -> UnpressFull -> PressUnsealed -> PressSealed --+

It is:

UnpressEmpty -> UnpressFull -> PressUnsealed --+
                                                |
    +-------------------------------------------+
    |
    V
   Sealed -> Empty -> Full --+
    A                        |
    |                        |
    +------------------------+


Is this what what meant to happen?

Brian




More information about the Shootout-list mailing list