On Your Own... I am seeing cross eyed!


#1



<!DOCTYPE html>
<html>
    <head>
		<title>Your own do-while</title>
        <link type='text/css' rel='stylesheet' href='style.css'/>
	</head>
	<body>
    <?php
        //write your do-while loop below
        $rollnumber = 0;
    
    do {
        $roll = rand(1,6);
        $rollcount ++;
        if ($roll == 6) { 
            echo "<p> We Got 6 Baby!!!</p>";}
            else { 
                echo "<p> We got {$roll} and we are not happy about it!</p>";
                }
    }
    while ($roll != 6);
    $verb = "were";
    $last = "rolls";
    if ($rollcount == 1) {
        $verb = "Was";
        $last = "Roll";
    }
    echo "<p>There {$verb} {$rollcount) ($last)!</p>";
    ?>
    </body>
</html>


#2

https://www.codecademy.com/courses/web-beginner-en-5YvPF/0/7

Where else do we see the above variable in the sample code?

Is this what you meant to initialize? As it stands, it is undefined and cannot be incremented.

$rollcount = 0;
do {
    // ...
    $rollcount++;
    // ...
}
// while ( ...

Mixed interpolation syntax.

"<p>There {$verb} {$rollcount} {$last}!</p>"