Last active
November 22, 2021 21:13
-
-
Save koen253janssen/8164970 to your computer and use it in GitHub Desktop.
PHP Dice script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/// Script start | |
/// Creates variable $dice and sets the content to a random number between the 1 and 6 | |
$dice = rand(1,6); | |
/// Display $dice | |
echo $dice; | |
/// If $dice is a 6 then display echo message | |
if($dice == 6) { | |
echo "Good Job! you threw a 6."; | |
} | |
/// If $dice is lower then 3 display echo message | |
if($dice < 3) { | |
echo "Don't give up try again!"; | |
} | |
/// Script end | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment