Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $counter = 0;
- for( $i = 0; $i < 500; $i++ )
- {
- $die1 = rand( 1 , 6 );
- $die2 = rand( 1 , 6 );
- if( $die1 + $die2 == 7 )
- $counter++;
- }
- echo "You rolled a seven " . $counter . " times!";
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement