Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- **** COMMODORE 64 BASIC V2 ****
- 64K RAM SYSTEM 38911 BASIC BYTES FREE
- READY.
- 10 X = RND(-TI)
- 20 T = 0 : REM Times where gold was picked first
- 30 G = 0 : REM Times where gold was also picked second
- 40 FOR X = 0 TO 100000
- 50 D1 = INT(RND(1)*3)+1 : REM Which bag?
- 70 IF D1 = 1 THEN 100 : REM Chose first bag
- 80 IF D1 = 2 THEN 200 : REM Chose second bag
- 90 GOTO 250 : REM Chose third bag
- 100 T = T + 1
- 110 G = G + 1 : REM First bag, both are gold gold
- 120 GOTO 250
- 200 D2 = INT(RND(1)*2)+1 : REM Pick ball
- 210 IF D2 = 2 THEN 250 : REM Took a silver ball
- 220 T = T + 1 : REM Took a gold ball
- 250 NEXT
- 300 PRINT G/T
- RUN
- .670560372
- READY.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement