Skip to content
Snippets Groups Projects
Commit b7a3b2a8 authored by steven.liatti's avatar steven.liatti
Browse files
parents 0a8d93ca 3f8b4fe7
No related branches found
No related tags found
No related merge requests found
......@@ -8,11 +8,11 @@
- Uniquement une abstraction + une implémentation avec liste ou tableau
- L'abstraction doit avoir au moins deux méthodes par défaut (non statiques)
- Corrigez le nom de la méthode `exist` en `exists`
- 13.11.2019: Le rendu est bien le 15 novembre
- 13.11.2019: Le rendu est bien le 17 novembre à 22h00
## Délais
- 15 novembre à 22h00: Rendu de la version 1 de votre TP (`tag v1.0`)
- 17 novembre à 22h00: Rendu de la version 1 de votre TP (`tag v1.0`)
- Ensemble des fonctionnalités sur les vecteurs (package `ch.hepia.numeric`)
- Deux fonctionnalités du pendu (package `ch.hepia.hangman`)
- L'ensemble des fonctionnalités sur le tas binaire (package `ch.hepia.strucure`)
......@@ -31,7 +31,7 @@ Après avoir choisi votre binôme, vous devrez **impérativement** :
- Ajouter Joel Cavat (@joel.cavat), Jeremy Gobet (@jeremy.gobet) et Steven Liatti (@steven.liatti) en tant que *Reporter* de votre repository.
- Lire attentivement l'énoncé.
# Itération 1 (tag `v1.0` - 22 novembre à 22h00)
# Itération 1 (tag `v1.0` - 17 novembre à 22h00)
## Fonctionnalités à réaliser sur les vecteurs
......@@ -273,6 +273,44 @@ qui sera une alternative de `Vector.linespace(0.0, 5.0, 20)`.
## Fonctionnalités à réaliser sur le pendu
Modifiez le jeux pour une utilisation suivante :
```java
Hangman h = Hangman.withSecretWord("mystere");
/*
* variante: Hangman h = Hangman.randomWord();
* (choisit aléatoirement un mot dans une liste)
* doit être implémenté !
*/
String currentWord = h.currentWord(); // currentWord = "_______";
h = h.tryWith('h');
int attempts = h.attempts(); // attempts = 1
int failedAttempts = h.failedAttempts(); // attempts = 1
currentWord = h.currentWord(); // currentWord = "_______";
h.printGallowIfError(); // affiche la potence uniquement si le dernier essai est mauvais
h = h.tryWith('s');
attempts = h.attempts(); // attempts = 2
failedAttempts = h.failedAttempts(); // attempts = 1
currentWord = h.currentWord(); // currentWord = "____e_e";
h.printGallowIfError();
h.printGallow(); // affiche la potence même si aucune erreur
// Utilisation finale
while ( !h.isFinished() ) {
String letter = askLetter(); // demande une lettre à l'utilisateur
h = h.tryWith( letter );
h.printCurrentWord();
h.printGallowIfError();
}
if( h.hasWon() ) {
System.out.println("Bravo");
} else {
System.out.println("Failed");
}
```
## Fonctionnalités à réaliser sur les structures
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment