On Apr 1, 2006, at 10:03 AM, ara.t.howard / noaa.gov wrote:

> On Sat, 1 Apr 2006, Niklas Frykholm wrote:
>
>>
>>> another thing a real Boolean class could give is a 'maybe' obj  
>>> such that
>>>     maybe or true                   -> maybe
>>>     maybe or true and false or true -> maybe
>>>     maybe and false                 -> maybe
>>
>> What whould this do
>>
>>   print "hello" if maybe
>>
>> or this
>>
>>   while maybe
>>      print "hello"
>>   end
>
> in a conditional it should evaluate to true/false radomly - compute  
> a random
> number and look at the last bit for instance, 0 -> false, 1 -> true.
>
>   harp:~ > cat a.rb
>   def maybe() [rand].pack('f').unpack('c').first[0].zero?  end
>
>   puts "hello" while maybe
>
>
>   harp:~ > ruby a.rb
>   hello
>   hello
>
>
>   harp:~ > ruby a.rb
>   hello
>   hello
>   hello
>   hello
>
>
>   harp:~ > ruby a.rb
>   hello
>
>
>   harp:~ > ruby a.rb
>   hello
>
>
> cheers.
>
> -a
> -- 
> share your knowledge.  it's a way to achieve immortality.
> - h.h. the 14th dali lama
>

As if my code wasn't already non-deterministic