Browse Source

merge into master

master
Younes El Omari 3 years ago
parent
commit
c4cd4a8eff
1 changed files with 0 additions and 41 deletions
  1. 0
    41
      index.php

+ 0
- 41
index.php View File

@@ -49,7 +49,6 @@ class Sub


<?php
<<<<<<< HEAD



@@ -150,46 +149,6 @@ class Sub
// }
//}

=======
// Naar php-modus
$pos = rand(0, 20);
$ammo = 3;
$win = false;
$submit = $_POST['shot'];
echo $pos;
?>
<!-- Terug in HTML modus -->
<form action="/zeeslag/index.php" method="POST">
<label for="shot">Shot: </label><br>
<input type="text" id="shot" name="shot" required>
<input type="submit" value="submit">
</form>

<?php
if($ammo > 0 && !$win) {
$ammo--;
echo ($ammo + " more shots");
}elseif($submit != $pos && $ammo == 0){
echo ("Game Over");
}else{
echo "You won";
$win = TRUE;
}
?>
<?php
for($i = 0; $i < $ammo; $i++){
if($ammo > 0 && !$win) {
echo ($ammo + " more shots");
}elseif($submit != $pos && $ammo == 0){
echo ("Game Over");
}else{
echo "You won";
$win = TRUE;
}
}
>>>>>>> master
?>
<!-- HTML -->
</body>

Loading…
Cancel
Save