fmutunga

20 Reputation

2 Badges

4 years, 170 days

MaplePrimes Activity


These are replies submitted by fmutunga

@fmutunga 

game := proc () local player1, player2, roll; roll := rand(1 .. 6); player1 := roll(); player2 := roll(2); if player2 < player1 then "A wins" elif player1 = player2 then "Tie" else "B wins" end if end proc:

game();

"B wins"

(1)

game();

"B wins"

(2)

game();

"Tie"

(3)

data := [seq(game(), i=1..1000)]:
Statistics[Tally](data);

["Tie" = 142, "B wins" = 417, "A wins" = 441]

(4)

Download game.mw

 

@tomleslie 

 

Tomleslie I have attached the sheet. It now works I don't know why it was giving the error. Thanks for the help.

@tomleslie , Preben, Rouben

Thanks for the comments. I run into this error while using maple 2015, after going though your posts, I decided to use maple 18 and it just the procedure executes just fine. I wonder what might me be happening? Could it be my setting or it has something to do with maple 2015?

fmutu

 

Page 1 of 1