<html>
<head>
<meta charset="UTF-8" />
<title>Bier zählen</title>
</head>
<body>
<?php
$x = rand(1, 99);
echo "Start: ".$x;
$count = 0;
while ($x != 1) {
if ($x % 2 == 0) {
$x = $x / 2;
} else {
$x = 3 * $x + 1;
};
$count = $count + 1;
}
echo "<br><br>Schritte: ".$count;
echo "<br><br>Ende: ".$x;
?>
</body>
</html>