This forum is now read-only. Please use our new forums at discuss.codecademy.com.

While Loops in PHP Forum

View Course » View Exercise

614 points
5582e1e0e39efe794f00029c_475433805
Submitted by
Tarun Jaluthria
almost 2 years ago

Not working on my google chrome...when i copy-paste these code to sublime text...

<!DOCTYPE html>



More Coin Flips


We will keep flipping a coin as long as the result is heads!
<?php
$flipCount = 0;
do {
$flip = rand(0,1);
$flipCount ++;
if ($flip){
echo "H";
}
else {
echo "T";
}
} while ($flip);
$verb = "were";
$last = "flips";
if ($flipCount == 1) {
$verb = "was";
$last = "flip";
}
echo "There {$verb} {$flipCount} {$last}!";
?>


.
.
.
.
.
style.css
.coin {
height: 50px;
width: 50px;
border-radius: 25px;
background-color: grey;
text-align: center;
font-weight: bold;
font-family: sans-serif;
color: white;
margin: 10px;
display: inline-block;
line-height: 50px;
font-size: 20px;
}

not working on my sublime text as well as in google chrome...


0 votes

permalink

Mostly works in mozila firefox.

225 points
531984708c3e1bb7911eb31eeaf2808c?s=140&d=retro
Submitted by
swapnil19
almost 2 years ago