The program:

!FLIP a coin five times

!RANDOMIZE

 

FOR toss = 1 to 5

IF rnd <.5 then

PRINT "Heads, you win"

LET heads = heads + 1

ELSE

PRINT "Tails, you lose"

LET tails = tails + 1

END IF

NEXT toss

PRINT

PRINT "You won";heads;"times. I won"; tails; "times."

END

Produces the same output every time:

You won 2 times. I won 3 times.

Tails, you lose

Heads, you win

Tails, you lose

Heads, you win

Tails, you lose

 

You won 2 times. I won 3 times.

The program:

!FLIP a coin five times

RANDOMIZE

 

FOR toss = 1 to 5

IF rnd <.5 then

PRINT "Heads, you win"

LET heads = heads + 1

ELSE

PRINT "Tails, you lose"

LET tails = tails + 1

END IF

NEXT toss

PRINT

PRINT "You won";heads;"times. I won"; tails; "times."

END

Produces a different output every time:

for example

Heads, you win

Heads, you win

Tails, you lose

Heads, you win

Heads, you win

 

You won 4 times. I won 1 times.