-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
63 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# 1. Enoncé | ||
|
||
On décrit le jeu des allumettes : au départ, il y a un tas de 50 allumettes, (ou tout autre objet : cailloux, jetons, . . .). Chacun à son tour, les deux joueurs ôtent obligatoirement entre 1 et 6 allumettes. Celui qui ôte la dernière allumette gagne. | ||
|
||
*Contraintes:* | ||
|
||
- Langage : JS ou Python. | ||
- Suivez les étapes. | ||
- Une fonctionnalité = une fonction. | ||
|
||
## Étape 1 | ||
|
||
Faire une fonction qui prend en paramètre le nombre d'allumettes à enlever du reste. | ||
|
||
Pour rappel, une nom de fonction doit décrire clairement ce que fait celle-ci. | ||
|
||
## Étape 2 | ||
|
||
Demander a l'utilisateur combien d'allumettes il souhaite retirer tant qu’il y a des allumettes dans le tas. Pour rappel, on a 50 allumettes au départ. | ||
|
||
## Étape 3 | ||
|
||
Limiter le nombre d’allumettes à pouvoir être retirées de 1 à 6. | ||
|
||
Ajouter a votre jeu la notion de victoire. | ||
|
||
## Étape 4 | ||
|
||
Rajouter un 2eme joueur à votre jeu. | ||
|
||
## Étape **5** | ||
|
||
Proposer un mode multi-joueur. Demander à l’utilisateur, combien il y a de joueur et gérer la partie en conséquence. | ||
|
||
## Étape 6 | ||
|
||
Libre à vous de faire une interface graphique à votre goût ! |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
h1 { | ||
color: rgb(273, 72, 50); | ||
background-color: rgb(248, 217, 209); | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<title>Ada exersise</title> | ||
<meta charset="UTF-8" name="viewport" content="width=device-width, initial-scale=1"> | ||
<link rel="stylesheet" href="css/style.css"> | ||
</head> | ||
<body> | ||
|
||
<h1>Ada Tech School (ex07 matches game)</h1> | ||
|
||
<script src="js/script.js"></script> | ||
</body> | ||
</html> |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
let matches = 50; | ||
|
||
function removeMatches(matchesToRemove) { | ||
matches -= matchesToRemove; | ||
if (matches < 0) { | ||
matches = 0; | ||
} | ||
} |