Question: Questions about loops

I'm new to Maple, and I come from using Matlab.  Apparently my Matlab way of thinking isn't working on Maple.  I'm trying  to ride a bit of code that simulates flipping a coin 1000 times.  The code counts one partiuclar result (1=heads) at the end prints that result.


Here's the code:




for i from 1 to 10000 do  

roll := rand(1..2):  


if (roll=1) then count:=count+1 end if  

end do  


 I get errors saying I didn't terminate my loops correctly.  Help, please.

Please Wait...