Skip to content

Instantly share code, notes, and snippets.

@flaviors200 flaviors200/do-while.php
Last active Jun 9, 2019

Embed
What would you like to do?
Loop statements: do-while
<?php
$attempts = 1;
do {
$coinFlip = random_int(0,1); // 0 testa 1 croce
echo "Lancio n. $attempts: $coinFlip\n";
$attempts--;
} while ($attempts < 10);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.