Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <title>A loop of your own</title>
- <link type='text/css' rel='stylesheet' href='style.css'/>
- </head>
- <body>
- <?php
- //Add while loop below
- $rolls = 0;
- $streetprogress = 0;
- $lastroll = 0;
- while($streetprogress < 3){
- $roll = rand(1,6);
- $rolls ++;
- if($streetprogress == 0){
- $streetprogress ++;
- }
- else if($roll == $lastroll ++)
- {
- $streetprogress ++;
- }
- else
- {
- $streetprogress = 0;
- };
- echo $roll;
- echo "<p>";
- $lastroll = $roll;
- }
- echo "congratulations, you hit the Jackpot!";
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement