forked from menault/TD3_DEV51_Qualite_Algo
Compare commits
13 Commits
06daa4e478
...
amary
| Author | SHA1 | Date | |
|---|---|---|---|
| 77b3158262 | |||
| 0f7c1f6b71 | |||
| 9d7c681ca3 | |||
| e6e0d4cf71 | |||
| ffbe1e232e | |||
| a3627d9023 | |||
| 2a8eac0720 | |||
| 7206dca3ef | |||
| 0fa7ec527f | |||
| f7aecb038d | |||
| 62f6f94be7 | |||
| 90874a3296 | |||
| 49e32b316e |
5
Makefile
5
Makefile
@@ -21,7 +21,7 @@ CLASSFILES = Pendu.class \
|
||||
$(OUT)Pendu.class : $(IN)Pendu.java $(OUT)Partie.class $(OUT)Fenetre.class
|
||||
$(JC) $(JCFLAGS) $<
|
||||
|
||||
$(OUT)Partie.class : $(IN)Partie.java
|
||||
$(OUT)Partie.class : $(IN)Partie.java $(OUT)Mots.class
|
||||
$(JC) $(JCFLAGS) $<
|
||||
|
||||
$(OUT)Fenetre.class : $(IN)Fenetre.java $(OUT)Partie.class $(OUT)Dessin.class
|
||||
@@ -30,6 +30,9 @@ $(OUT)Fenetre.class : $(IN)Fenetre.java $(OUT)Partie.class $(OUT)Dessin.class
|
||||
$(OUT)Dessin.class : $(IN)Dessin.java
|
||||
$(JC) $(JCFLAGS) $<
|
||||
|
||||
$(OUT)Mots.class : $(IN)Mots.java
|
||||
$(JC) $(JCFLAGS) $<
|
||||
|
||||
# Commandes
|
||||
Pendu : $(OUT)Pendu.class
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import java.awt.*;
|
||||
/**
|
||||
* La classe <code>Dessin</code> gère uniquement le dessin du pendu
|
||||
*
|
||||
* @version 0.1
|
||||
* @version 1.0
|
||||
* @author Adrien
|
||||
* Date : 08-10-2025
|
||||
* Licence :
|
||||
@@ -47,8 +47,7 @@ public class Dessin extends JPanel {
|
||||
graphics2D.drawLine(postXCoordinate, marginPixels, postXCoordinate + beamLength, marginPixels);
|
||||
|
||||
// Renfort diagonal
|
||||
graphics2D.drawLine(postXCoordinate, marginPixels + height / 10,
|
||||
postXCoordinate + width / 12, marginPixels);
|
||||
graphics2D.drawLine(postXCoordinate, marginPixels + height / 10, postXCoordinate + width / 12, marginPixels);
|
||||
|
||||
// Corde
|
||||
int ropeXCoordinate = postXCoordinate + beamLength;
|
||||
@@ -60,8 +59,7 @@ public class Dessin extends JPanel {
|
||||
int headRadiusPixels = Math.min(width, height) / 16;
|
||||
int headCenterX = ropeXCoordinate;
|
||||
int headCenterY = ropeBottomYCoordinate + headRadiusPixels;
|
||||
graphics2D.drawOval(headCenterX - headRadiusPixels, headCenterY - headRadiusPixels,
|
||||
headRadiusPixels * 2, headRadiusPixels * 2);
|
||||
graphics2D.drawOval(headCenterX - headRadiusPixels, headCenterY - headRadiusPixels, headRadiusPixels * 2, headRadiusPixels * 2);
|
||||
|
||||
// Corps
|
||||
int bodyTopYCoordinate = headCenterY + headRadiusPixels;
|
||||
@@ -71,17 +69,13 @@ public class Dessin extends JPanel {
|
||||
// Bras
|
||||
int armSpanPixels = width / 10;
|
||||
int shouldersYCoordinate = bodyTopYCoordinate + height / 24;
|
||||
graphics2D.drawLine(headCenterX, shouldersYCoordinate,
|
||||
headCenterX - armSpanPixels, shouldersYCoordinate + height / 20);
|
||||
graphics2D.drawLine(headCenterX, shouldersYCoordinate,
|
||||
headCenterX + armSpanPixels, shouldersYCoordinate + height / 20);
|
||||
graphics2D.drawLine(headCenterX, shouldersYCoordinate, headCenterX - armSpanPixels, shouldersYCoordinate + height / 20);
|
||||
graphics2D.drawLine(headCenterX, shouldersYCoordinate, headCenterX + armSpanPixels, shouldersYCoordinate + height / 20);
|
||||
|
||||
// Jambes
|
||||
int legSpanPixels = width / 12;
|
||||
graphics2D.drawLine(headCenterX, bodyBottomYCoordinate,
|
||||
headCenterX - legSpanPixels, bodyBottomYCoordinate + height / 8);
|
||||
graphics2D.drawLine(headCenterX, bodyBottomYCoordinate,
|
||||
headCenterX + legSpanPixels, bodyBottomYCoordinate + height / 8);
|
||||
graphics2D.drawLine(headCenterX, bodyBottomYCoordinate, headCenterX - legSpanPixels, bodyBottomYCoordinate + height / 8);
|
||||
graphics2D.drawLine(headCenterX, bodyBottomYCoordinate, headCenterX + legSpanPixels, bodyBottomYCoordinate + height / 8);
|
||||
|
||||
graphics2D.dispose();
|
||||
}
|
||||
|
||||
62
src/Event.java
Normal file
62
src/Event.java
Normal file
@@ -0,0 +1,62 @@
|
||||
import javax.swing.*;
|
||||
import java.awt.event.*;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
/**
|
||||
* La classe <code>Event</code> regroupe et branche tous les listeners liés à Fenetre.
|
||||
* - Validation de la saisie (1 lettre A-Z, majuscule)
|
||||
* - Action sur Entrée ou clic bouton
|
||||
* - Notification du handler externe (fourni au constructeur)
|
||||
* Aucune logique de jeu ici.
|
||||
* @version 1.3
|
||||
* author Adrien
|
||||
* Date : 08-10-2025
|
||||
*/
|
||||
public class Event implements ActionListener {
|
||||
|
||||
private final Fenetre window;
|
||||
private final Consumer<Character> onLetterSubmitted;
|
||||
|
||||
/** Constructeur : conserve les références et branche les événements. */
|
||||
public Event(Fenetre window, Consumer<Character> onLetterSubmitted) {
|
||||
this.window = window;
|
||||
this.onLetterSubmitted = onLetterSubmitted;
|
||||
wireEvents();
|
||||
}
|
||||
|
||||
/** Branche les listeners sur les composants de Fenetre. */
|
||||
private void wireEvents() {
|
||||
JTextField letterInput = window.getLetterInput();
|
||||
JButton sendButton = window.getSendButton();
|
||||
|
||||
// Même listener (this) pour Entrée et clic bouton
|
||||
sendButton.addActionListener(this);
|
||||
letterInput.addActionListener(this);
|
||||
|
||||
// UX : limiter à une seule lettre et forcer la majuscule (classe dédiée)
|
||||
letterInput.addKeyListener(new LetterInputFilter(letterInput));
|
||||
}
|
||||
|
||||
/** Réagit à Entrée ou au clic bouton : récupère, valide et transmet la lettre. */
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent actionEvent) {
|
||||
JTextField letterInput = window.getLetterInput();
|
||||
|
||||
String inputText = letterInput.getText().trim().toUpperCase();
|
||||
letterInput.setText(""); // reset du champ après tentative
|
||||
|
||||
// Validation : exactement une lettre A–Z
|
||||
if (inputText.length() != 1 || !inputText.matches("[A-Z]")) {
|
||||
JOptionPane.showMessageDialog(window.getWindow(), "Veuillez entrer une seule lettre (A-Z).");
|
||||
return;
|
||||
}
|
||||
|
||||
// Notification du handler externe, sinon placeholder
|
||||
if (onLetterSubmitted != null) {
|
||||
onLetterSubmitted.accept(inputText.charAt(0));
|
||||
} else {
|
||||
JOptionPane.showMessageDialog(window.getWindow(),
|
||||
"Lettre soumise (placeholder) : " + inputText);
|
||||
}
|
||||
}
|
||||
}
|
||||
111
src/Fenetre.java
111
src/Fenetre.java
@@ -1,40 +1,38 @@
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
import java.awt.event.*;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
/**
|
||||
* La classe <code>Fenetre</code> gère uniquement l'interface graphique :
|
||||
* - zone de dessin (assurée par la classe Dessin)
|
||||
* - affichage du mot masqué
|
||||
* - saisie d'une lettre (événement remonté via un handler)
|
||||
*
|
||||
* Aucune logique de jeu (choix/vérification du mot) n'est ici.
|
||||
*
|
||||
* @version 1.0
|
||||
* @author Adrien
|
||||
* Date : 08-10-25
|
||||
* Licence :
|
||||
*/
|
||||
* La classe <code>Fenetre</code> gère uniquement l'interface graphique :
|
||||
* - zone de dessin (assurée par la classe Dessin)
|
||||
* - affichage du mot masqué
|
||||
* - saisie d'une lettre (les événements sont gérés dans Event)
|
||||
*
|
||||
* Aucune logique de jeu ici.
|
||||
* @version 1.5
|
||||
* @author Adrien
|
||||
* Date : 08-10-2025
|
||||
* Licence :
|
||||
*/
|
||||
|
||||
public class Fenetre {
|
||||
|
||||
// --- Composants de l'interface (UI only) ---
|
||||
// --- Composants de l'interface ---
|
||||
private JFrame window;
|
||||
private JLabel wordLabel;
|
||||
private JTextField letterInput;
|
||||
private JButton sendButton;
|
||||
private JPanel drawZone; // instance de Dessin
|
||||
|
||||
// Handler externe pour la lettre soumise (fourni par la classe Partie / contrôleur)
|
||||
private Consumer<Character> onLetterSubmitted;
|
||||
|
||||
// --- Constructeur (orchestration courte) ---
|
||||
// --- Constructeur ---
|
||||
public Fenetre() {
|
||||
setupWindow();
|
||||
JPanel root = createRoot();
|
||||
|
||||
JPanel root = new JPanel();
|
||||
root.setLayout(new BoxLayout(root, BoxLayout.Y_AXIS));
|
||||
window.setContentPane(root);
|
||||
|
||||
drawZone = createDrawZone(); // -> new Dessin()
|
||||
drawZone = new Dessin();
|
||||
root.add(drawZone);
|
||||
|
||||
wordLabel = createWordLabel();
|
||||
@@ -48,7 +46,6 @@ public class Fenetre {
|
||||
}
|
||||
|
||||
// --- Initialisation fenêtre ---
|
||||
/** Configure la fenêtre principale (titre, taille, fermeture). */
|
||||
private void setupWindow() {
|
||||
window = new JFrame("Jeu du Pendu");
|
||||
window.setSize(600, 600);
|
||||
@@ -56,20 +53,7 @@ public class Fenetre {
|
||||
window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||
}
|
||||
|
||||
/** Crée le conteneur principal vertical. */
|
||||
private JPanel createRoot() {
|
||||
JPanel root = new JPanel();
|
||||
root.setLayout(new BoxLayout(root, BoxLayout.Y_AXIS));
|
||||
return root;
|
||||
}
|
||||
|
||||
// --- Sous-composants UI ---
|
||||
/** Crée la zone de dessin via la classe Dessin. */
|
||||
private JPanel createDrawZone() {
|
||||
return new Dessin();
|
||||
}
|
||||
|
||||
/** Crée le label d'affichage du mot (placeholder jusqu'à injection par Partie). */
|
||||
private JLabel createWordLabel() {
|
||||
JLabel label = new JLabel("_ _ _ _ _", SwingConstants.CENTER);
|
||||
label.setFont(new Font("Segoe UI", Font.BOLD, 32));
|
||||
@@ -78,7 +62,6 @@ public class Fenetre {
|
||||
return label;
|
||||
}
|
||||
|
||||
/** Crée la zone de saisie (champ + bouton) et branche l'action. */
|
||||
private JPanel createInputPanel() {
|
||||
JPanel inputPanel = new JPanel(new FlowLayout(FlowLayout.CENTER, 10, 10));
|
||||
JLabel prompt = new JLabel("Entrez une lettre :");
|
||||
@@ -89,57 +72,27 @@ public class Fenetre {
|
||||
|
||||
sendButton = new JButton("Envoyer");
|
||||
|
||||
Action sendAction = new AbstractAction() {
|
||||
@Override public void actionPerformed(ActionEvent e) { submitLetter(); }
|
||||
};
|
||||
sendButton.addActionListener(sendAction);
|
||||
letterInput.addActionListener(sendAction);
|
||||
|
||||
letterInput.addKeyListener(new KeyAdapter() {
|
||||
@Override public void keyTyped(KeyEvent e) {
|
||||
char c = e.getKeyChar();
|
||||
if (!Character.isLetter(c) || letterInput.getText().length() >= 1) e.consume();
|
||||
else e.setKeyChar(Character.toUpperCase(c));
|
||||
}
|
||||
});
|
||||
|
||||
inputPanel.add(prompt);
|
||||
inputPanel.add(letterInput);
|
||||
inputPanel.add(sendButton);
|
||||
return inputPanel;
|
||||
}
|
||||
|
||||
// --- Partie <-> UI ---
|
||||
|
||||
/** Définit le texte du mot affiché (ex: "_ _ A _ _") fourni par la classe Partie. */
|
||||
public void setWordDisplay(String maskedWord) {
|
||||
wordLabel.setText(maskedWord != null ? maskedWord : "");
|
||||
}
|
||||
|
||||
/** Définit le handler appelé quand l'utilisateur soumet une lettre. */
|
||||
public void setOnLetterSubmitted(Consumer<Character> handler) {
|
||||
this.onLetterSubmitted = handler;
|
||||
}
|
||||
|
||||
// --- Méthodes privées UI ---
|
||||
/** Récupère la lettre et notifie le handler externe (aucune logique de jeu ici). */
|
||||
private void submitLetter() {
|
||||
String text = letterInput.getText().trim().toUpperCase();
|
||||
letterInput.setText("");
|
||||
if (text.length() != 1 || !text.matches("[A-Z]")) {
|
||||
JOptionPane.showMessageDialog(window, "Veuillez entrer une seule lettre (A-Z).");
|
||||
return;
|
||||
}
|
||||
if (onLetterSubmitted != null) onLetterSubmitted.accept(text.charAt(0));
|
||||
else JOptionPane.showMessageDialog(window, "Lettre soumise (placeholder) : " + text);
|
||||
}
|
||||
// --- Getters pour Event ---
|
||||
public JFrame getWindow() { return window; }
|
||||
public JTextField getLetterInput() { return letterInput; }
|
||||
public JButton getSendButton() { return sendButton; }
|
||||
public JLabel getWordLabel() { return wordLabel; }
|
||||
public JPanel getDrawZone() { return drawZone; }
|
||||
|
||||
// --- Méthode principale de test ---
|
||||
public static void main(String[] args) {
|
||||
Fenetre f = new Fenetre();
|
||||
f.setWordDisplay("_ _ _ _ _"); // placeholder
|
||||
f.setOnLetterSubmitted(ch ->
|
||||
JOptionPane.showMessageDialog(null, "Lettre reçue : " + ch + " (sans logique de jeu)")
|
||||
);
|
||||
SwingUtilities.invokeLater(() -> {
|
||||
Fenetre f = new Fenetre();
|
||||
// On passe le handler directement ici (pas de setOnLetterSubmitted)
|
||||
new Event(f, ch ->
|
||||
JOptionPane.showMessageDialog(f.getWindow(), "Lettre reçue : " + ch + " (sans logique de jeu)")
|
||||
);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
47
src/LetterInputFilter.java
Normal file
47
src/LetterInputFilter.java
Normal file
@@ -0,0 +1,47 @@
|
||||
import javax.swing.*;
|
||||
import java.awt.event.KeyAdapter;
|
||||
import java.awt.event.KeyEvent;
|
||||
|
||||
/**
|
||||
* La classe <code>LetterInputFilter</code> limite la saisie d'un champ texte
|
||||
* à une seule lettre de l'alphabet (A–Z), en forçant automatiquement
|
||||
* la majuscule. Toute autre frappe est ignorée.
|
||||
*
|
||||
* @version 1.0
|
||||
* @author Adrien
|
||||
* Date : 08-10-2025
|
||||
* Licence :
|
||||
*/
|
||||
public class LetterInputFilter extends KeyAdapter {
|
||||
|
||||
/** Référence vers le champ de saisie à filtrer. */
|
||||
private final JTextField letterInput;
|
||||
|
||||
//Constructeur.
|
||||
public LetterInputFilter(JTextField letterInput) {
|
||||
if (letterInput == null) {
|
||||
throw new NullPointerException("letterInput ne doit pas être null");
|
||||
}
|
||||
this.letterInput = letterInput;
|
||||
}
|
||||
|
||||
/**
|
||||
* Intercepte les frappes clavier et applique les règles suivantes :
|
||||
* - n'accepte que les lettres (A–Z)
|
||||
* - limite la saisie à un seul caractère
|
||||
* - force la majuscule sur le caractère saisi.
|
||||
*/
|
||||
@Override
|
||||
public void keyTyped(KeyEvent keyEvent) {
|
||||
char typedChar = keyEvent.getKeyChar();
|
||||
|
||||
// Refuse tout caractère non alphabétique ou une saisie > 1 caractère.
|
||||
if (!Character.isLetter(typedChar) || letterInput.getText().length() >= 1) {
|
||||
keyEvent.consume(); // ignore la frappe
|
||||
return;
|
||||
}
|
||||
|
||||
// Force la majuscule.
|
||||
keyEvent.setKeyChar(Character.toUpperCase(typedChar));
|
||||
}
|
||||
}
|
||||
58
src/Mots.java
Normal file
58
src/Mots.java
Normal file
@@ -0,0 +1,58 @@
|
||||
|
||||
/**
|
||||
* La classe <code>Mots</code>
|
||||
*
|
||||
* @version 1.0
|
||||
* @author Aurélien
|
||||
* Date : 08-10-25
|
||||
* Licence :
|
||||
*/
|
||||
public final class Mots {
|
||||
//Attributs
|
||||
public static final short dictionarysize = 32 ;
|
||||
public static final String[] dictionary = {
|
||||
"Magnifique",
|
||||
"Etoile",
|
||||
"Voyage",
|
||||
"Biscuit",
|
||||
"Refrigerateur",
|
||||
"Courage",
|
||||
"Avion",
|
||||
"Explorateur",
|
||||
"Montagne",
|
||||
"Philosophie",
|
||||
"Lumiere",
|
||||
"Ethernet",
|
||||
"Architecture",
|
||||
"Ocean",
|
||||
"Liberte",
|
||||
"Aventure",
|
||||
"Cerise",
|
||||
"Harmonieux",
|
||||
"Informatique",
|
||||
"Pluie",
|
||||
"Equilibriste",
|
||||
"Papillon",
|
||||
"Saisons",
|
||||
"Liberte",
|
||||
"Alphabet",
|
||||
"Musique",
|
||||
"Translucent",
|
||||
"Passion",
|
||||
"Etreindre",
|
||||
"Poetique",
|
||||
"Serenite",
|
||||
"Révolution"
|
||||
};
|
||||
|
||||
//Constructeur
|
||||
private Mots() { //N'a pas pour but d'être instanciée
|
||||
throw new UnsupportedOperationException("The \"Fichier\" class cannot be instanced !");
|
||||
}
|
||||
//Méthodes
|
||||
|
||||
//Affichage
|
||||
public String toString() {
|
||||
return "" ;
|
||||
}
|
||||
}
|
||||
120
src/Partie.java
120
src/Partie.java
@@ -1,23 +1,135 @@
|
||||
import java.util.Random;
|
||||
|
||||
/**
|
||||
* La classe <code>Partie</code>
|
||||
*
|
||||
* @version
|
||||
* @author
|
||||
* Date :
|
||||
* @version 0.2
|
||||
* @author Aurélien
|
||||
* Date : 08-10-25
|
||||
* Licence :
|
||||
*/
|
||||
public class Partie {
|
||||
//Contantes
|
||||
private static final byte REMAININGTRY = 11 ;
|
||||
private static final byte CARACTERCODESHIFT = 65 ; //Décalage ASCI > 'A'
|
||||
|
||||
//Attributs
|
||||
private char[] secretword ;
|
||||
private byte wordsize ;
|
||||
private boolean[] foundletters ;
|
||||
private boolean[] entriesletters = new boolean[26] ; //Pseudo Alphabée
|
||||
private byte remainingtry = REMAININGTRY ;
|
||||
|
||||
//Constructeur
|
||||
public Partie() {
|
||||
|
||||
this.secretword = generateSecretWord() ;
|
||||
this.wordsize = (byte) secretword.length ;
|
||||
this.foundletters = new boolean[wordsize] ;
|
||||
}
|
||||
//Méthodes
|
||||
public char[] getSecretWord() {
|
||||
return this.secretword ;
|
||||
}
|
||||
|
||||
public boolean[] getFoundLetters() {
|
||||
return this.foundletters ;
|
||||
}
|
||||
|
||||
public byte getRemainingTry() {
|
||||
return this.remainingtry ;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Vérifie l'état de la partie en cours.
|
||||
*
|
||||
* @return true si le jeu est fini.
|
||||
*/
|
||||
public boolean gameIsEnding() {
|
||||
if(this.remainingtry <= 0){
|
||||
return true ;
|
||||
}else if(wordIsFound()){
|
||||
return true ;
|
||||
}else{
|
||||
return false ;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Vérifie si la lettre reçu n'a pas déjà été joué puis, met à jour le tableau "entriesletters" et
|
||||
* "foundletters" le cas échéant.
|
||||
*
|
||||
* @return true si la lettre était déjà présente.
|
||||
*/
|
||||
public boolean isAlreadyEntries(char letter) {
|
||||
short caractercode = (short) letter ; //Récupération du code du caractère
|
||||
if(this.entriesletters[caractercode-CARACTERCODESHIFT]){
|
||||
this.remainingtry-- ; //Décrément des essais
|
||||
return true ;
|
||||
}else{
|
||||
boolean isfind = false ;
|
||||
for(byte i = 0 ; i < this.wordsize ; i++){ //Parcours du "secretword"
|
||||
if(this.secretword[i] == letter){
|
||||
this.foundletters[i] = true ;
|
||||
isfind = true ;
|
||||
}
|
||||
}
|
||||
if(isfind == false){
|
||||
this.remainingtry-- ; //Décrément des essais
|
||||
}
|
||||
this.entriesletters[caractercode-CARACTERCODESHIFT] = true ; //Ajout au tableau des lettres jouées
|
||||
return false ;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Génère un mot à partir d'un grand dictionnaire (enfin en principe).
|
||||
*
|
||||
* @return le mot généré.
|
||||
*/
|
||||
private char[] generateSecretWord() {
|
||||
Random random = new Random();
|
||||
byte grain = (byte) random.nextInt(Mots.dictionarysize);
|
||||
char[] word = Mots.dictionary[grain].toUpperCase().toCharArray();
|
||||
return word ;
|
||||
}
|
||||
|
||||
private boolean wordIsFound() {
|
||||
for(byte i = 0 ; i < this.wordsize ; i++){ //Parcours du "secretword"
|
||||
if(!this.foundletters[i]){ //Si une lettre n'est pas trouvé
|
||||
return false ;
|
||||
}
|
||||
}
|
||||
return true ;
|
||||
}
|
||||
|
||||
|
||||
//Affichage
|
||||
public String toString() {
|
||||
return "" ;
|
||||
}
|
||||
|
||||
//Tests
|
||||
public static void main(String[] args){
|
||||
char[] test = {'E','O','M','I','E','D','A','Z','N','L','C','R','P','H','T','S'};
|
||||
byte size = (byte) test.length ;
|
||||
boolean status ;
|
||||
|
||||
Partie game = new Partie();
|
||||
System.out.println("Trick > " + String.valueOf(game.secretword) + "\n");
|
||||
for(byte i = 0 ; i < size && !game.gameIsEnding() ; i++){
|
||||
System.out.println("Essais restants : " + game.getRemainingTry());
|
||||
status = game.isAlreadyEntries(test[i]);
|
||||
for(byte l = 0 ; l < game.wordsize ; l++){ //Parcours du "secretword"
|
||||
if(game.foundletters[l] == true){
|
||||
System.out.print(game.getSecretWord()[l] + " ");
|
||||
}else{
|
||||
System.out.print("_ ");
|
||||
}
|
||||
}
|
||||
System.out.println(""); //Lisibilité
|
||||
//System.out.println("Lettres : " + game.entriesletters);
|
||||
}
|
||||
System.out.println("Essais restants : " + game.getRemainingTry());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user