FW: R. H. Rand's permission: german translation of your "introduction to maxima"[Scanned]
Subject: FW: R. H. Rand's permission: german translation of your "introduction to maxima"[Scanned]
From: van.Nek at gmx.net
Date: Mon, 16 Jan 2006 18:27:31 +0100
Am 16 Jan 2006 um 17:51 hat Robert Gloeckner geschrieben:
> roll_dice(n) := block (
> ~ [ tmp, count:[0,0,0,0,0,0] ],
> ~ for i:1 thru n do (
> ~ tmp: random(6)+1,
> ~ count[tmp]: count[tmp]+1 ),
> ~ count );
Hello Robert,
I guess you have copied this from my email via copy and paste.
By looking at the definition in %o1, I see that some characters are missing, the
definition is not complete.
> (%o1) roll_dice(n) := block([tmp, count : [0, 0, 0, 0, 0, 0]],
> for i thru n do (dom(6) + 1, count : count + 1), count)
> tmp tmp
> (%i2) (%i2) roll_dice(1000);
>
> Subscript must be an integer:
> tmp
As a consequence, tmp is not known.
I have no idea, why this happened. Please type in the code, don't paste it, and lets see
what happens.
Volker