This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
print("Tu te trouves dans une pièce obscure d'un mystérieux château.") | |
print("Tu dois choisir entre trois portes.") | |
choixJoueur = input("Choisis 1, 2 ou 3...") | |
if choixJoueur == "1": | |
print("Tu as trouvé un trésor. Tu es riche !") | |
print("Bravo, TU AS GAGNÉ !") | |
elif choixJoueur == "2": | |
print("La porte s'ouvre et un ogre affamé te donne un coup de massue.") | |
print("GAME OVER,TU AS PERDU !") | |
elif choixJoueur == "3": |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
réponse_utilisateur = input("Aime-tu les robots ? (Tape oui ou non) ") | |
if réponse_utilisateur == "oui": | |
print("Bip bip !") | |
elif réponse_utilisateur == "peut-être": | |
print("Décide toi humain !") | |
elif réponse_utilisateur == "Ceux aux yeux laser": | |
print("Zzzzzzap !") | |
elif réponse_utilisateur == "non": | |
print("Les robotsn ne t'aiment pas non plus.") | |
else: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
results = {"A X" => [4, 3], "B X" => [1, 1], "C X" => [7, 2], | |
"A Y" => [8, 4], "B Y" => [5, 5], "C Y" => [2, 6], | |
"A Z" => [3, 8], "B Z" => [9, 9], "C Z" => [6, 7]} | |
| |
sum_part_1 = lines.sum { |line| results[line][0] } | |
sum_part_2 = lines.sum { |line| results[line][1] } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Composant | |
Composant | |
Composant | |
Composant | |
Composant | |
Composant | |
Composant | |
Composant | |
Composant | |
Composant |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const eleves = [ | |
{ nom: 'Pierre', age: 15 }, | |
{ nom: 'Paul', age: 22 }, | |
{ nom: 'Jacques', age: 18 }, | |
{ nom: 'Jean', age: 17 } | |
]; | |
// const garderMajeurs = | |
const elevesMajeurs = eleves.filter(garderMajeurs); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const jobs = [ | |
{ id: 1, isActive: true }, | |
{ id: 2, isActive: true }, | |
{ id: 3, isActive: false } | |
]; | |
// const idMultiplier = | |
const jobsWithIdsMultipliedByTen = jobs.map(idMultiplier); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function power(base, exp) { | |
return base**exp; | |
} | |
console.log(power(2,3)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const person = { | |
name: 'Samuel', | |
talk() { | |
console.log(`Hello, my name is ${this.name}`); | |
} | |
}; | |
function sayMyName(name) { | |
console.log(`My name is ${this.name}`); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const person = { | |
name: 'Samuel', | |
talk() { | |
console.log(`Hello, my name is ${this.name}`); | |
} | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const samuelPath = { age: 30, profession: "instructeur JavaScript" }; | |
samuelPath.profession = "instructeur web avancé"; | |
console.log(samuelPath.profession); |
NewerOlder