Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: two dice question

by Scott7477 (Chaplain)
on Jul 19, 2007 at 15:38 UTC ( [id://627545]=note: print w/replies, xml ) Need Help??


in reply to two dice question

Here is my iteration of this functionality; I am not so interested in seeing the graphic image of the dice, but rather just getting roll results. quester's suggestions were appreciated. For what it's worth:

use strict; my $diceone = int(rand(6)) + 1; my $dicetwo = int(rand(6)) + 1; print "Rolling first die resulted in: "; print $diceone-1; print "\n"; print "Rolling second die resulted in: "; print $dicetwo-1; print "\n";


yields this result:

Rolling first die resulted in: 3
Rolling second die resulted in: 5

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://627545]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (6)
As of 2024-03-28 11:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found