Skip to content

Commit

Permalink
Fix the fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
timhaller committed Feb 23, 2024
1 parent e67361c commit 96e1ba4
Show file tree
Hide file tree
Showing 40 changed files with 101 additions and 0 deletions.
Binary file added exercices/m08/Penguin/img/1_1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added exercices/m08/Penguin/img/1_2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added exercices/m08/Penguin/img/1_3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added exercices/m08/Penguin/img/1_4.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added exercices/m08/Penguin/img/2_1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added exercices/m08/Penguin/img/2_2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added exercices/m08/Penguin/img/2_3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added exercices/m08/Penguin/img/2_4.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added exercices/m08/Penguin/img/3_1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added exercices/m08/Penguin/img/3_2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added exercices/m08/Penguin/img/3_3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added exercices/m08/Penguin/img/3_4.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added exercices/m08/Penguin/img/4_1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added exercices/m08/Penguin/img/4_2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added exercices/m08/Penguin/img/4_3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added exercices/m08/Penguin/img/4_4.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added exercices/m08/Penguin/img/5_1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added exercices/m08/Penguin/img/5_2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added exercices/m08/Penguin/img/5_3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added exercices/m08/Penguin/img/5_4.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added exercices/m08/Penguin/img/6_1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added exercices/m08/Penguin/img/6_2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added exercices/m08/Penguin/img/6_3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added exercices/m08/Penguin/img/6_4.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added exercices/m08/Penguin/img/7_1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added exercices/m08/Penguin/img/7_2.jpg
Binary file added exercices/m08/Penguin/img/7_3.jpg
Binary file added exercices/m08/Penguin/img/7_4.jpg
Binary file added exercices/m08/Penguin/img/pingouin.png
Binary file added exercices/m08/Penguin/img/pingouin_grand.png
Binary file added exercices/m08/Penguin/img/pingouin_jaune.png
Binary file added exercices/m08/Penguin/img/pingouin_rouge.png
Binary file added exercices/m08/Penguin/img/pingouin_vert.png
Binary file added exercices/m08/Penguin/img/vide.jpg
49 changes: 49 additions & 0 deletions exercices/m08/Penguin/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Le Jeu du Pinguin</title>
<link rel="stylesheet" href="styles.css" />
<script src="main.js" ></script>
</head>
<body>
<table>
<tr >
<td id="A1" class="image-cell image-start">
<img src="img/1_1.jpg" alt="Penguin"/>
</td>
<td id="A2" class="image-cell image-start">
<img src="img/1_2.jpg" alt="Penguin"/>
</td>
<td id="B1" class="image-cell image-start">
</td>
<td id="B2" class="image-cell image-start">
</td>
<td rowspan="4"></td>
</tr>
<tr>
<td id="A3" class="image-cell">
<img src="img/1_3.jpg" alt="Penguin">
</td>
<td id="A4" class="image-cell">
<img src="img/1_4.jpg" alt="Penguin">
</td>
<td id="B3" class="image-cell">3</td>
<td id="B4" class="image-cell">4</td>
</tr>
<tr>
<td colspan="2" >
<button onclick="NewGame()">
Nouvelle Partie
</button>
</td>
<td colspan="2">
Vérifier les réponses
</td>
</tr>
<tr>
<td colspan="4"></td>
</tr>
</table>
</body>
</html>
26 changes: 26 additions & 0 deletions exercices/m08/Penguin/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
function shuffleFucks(array) {
for (let i = array.length - 1; i > 0; i--) {
const j = Math.floor(Math.random() * (i + 1));
[array[i], array[j]] = [array[j], array[i]];
}
}

function NewGame() {
console.log("New")
let A1 = document.getElementById("A1")
let A2 = document.getElementById("A2")
let A3 = document.getElementById("A3")
let A4 = document.getElementById("A4")

let mountain = Math.floor(Math.random() * 7) + 1
let fucksToGive = [1, 2, 3, 4]

shuffleFucks(fucksToGive)
for (let i = 1; i <= fucksToGive.length; i++) {
console.log(i)
let fuckGiven = fucksToGive[i - 1]
let field = document.getElementsByClassName("image-start").item(i)
field.firstChild.src(`img/${mountain}_${fuckGiven}.jpg`)
console.log(`${mountain}_${fuckGiven}.jpg`)
}
}
26 changes: 26 additions & 0 deletions exercices/m08/Penguin/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}

body {
font-family: 'Arial', sans-serif;
background-color: #f2f2f2;
padding: 6rem;
}

td {
background: dodgerblue;
text-align: center;
}

table {
width: 100%;
}

.image-cell {
width: 180px;
height: 180px;
overflow: hidden;
}

0 comments on commit 96e1ba4

Please sign in to comment.