Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: two dice question

by Scott7477 (Chaplain)
on Jul 19, 2007 at 15:38 UTC ( #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
Node Status?
node history
Node Type: note [id://627545]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (3)
As of 2021-06-19 10:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What does the "s" stand for in "perls"? (Whence perls)












    Results (92 votes). Check out past polls.

    Notices?