Browse Source

Merge branch 'master' into 4de-poging

master
Younes El Omari 3 years ago
parent
commit
078a8df13e
2 changed files with 71 additions and 0 deletions
  1. 22
    0
      .vscode/launch.json
  2. 49
    0
      index.php

+ 22
- 0
.vscode/launch.json View File

@@ -0,0 +1,22 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Listen for XDebug",
"type": "php",
"request": "launch",
"port": 9000
},
{
"name": "Launch currently open script",
"type": "php",
"request": "launch",
"program": "${file}",
"cwd": "${fileDirname}",
"port": 9000
}
]
}

+ 49
- 0
index.php View File

@@ -1,3 +1,4 @@
<<<<<<< HEAD
<html>
<!-- Hier start het php-script te lopen -->

@@ -45,10 +46,18 @@ class Sub

?>

=======

<!-- Hier start het php-script te lopen -->
<html>
<!-- Hier start het php-script te lopen -->

>>>>>>> master
<body>


<?php
<<<<<<< HEAD



@@ -149,6 +158,46 @@ 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