How can a Ripple contract use random values and reach consensus? There an interesting page about contracts on the Ripple Wiki.

My limited understanding of contracts is that like other transactions in Ripple, it is the consensus across many servers that ensures validity.  Am I right that when a contract is running in Ripple, the code runs on multiple servers and consensus ensures the contract's instructions are run correctly?

If so, I'm particularly curious about the "Lotto" example on the wiki page.  It chooses one account randomly to be paid some amount of some currency.

If that code ran simultaneously on many Ripple servers, they'd each randomly choose a different winner.  How would they ever achieve consensus?
That contaracts wiki page may be out-of-date.
However, the loto example uses rand float which in the data access section of the wiki page is described as:


  
  this number is deterministically created based on the hash of the collection of transactions or something
  


That implies to me that it's random only in the sense that the contract itself, or any Ripple user, cannot guess what the value will be at run time, but once running all validators will use the same value.

This is similar to how some Bitcoin gambling sites work, using numbers based off the Bitcoin blockchain hash.