Skip to content
Snippets Groups Projects
Commit f9d41593 authored by HydroFlo's avatar HydroFlo
Browse files

edit

parent 3308e142
No related branches found
No related tags found
No related merge requests found
No preview for this file type
...@@ -408,7 +408,7 @@ class Labyrinthe extends Program{ ...@@ -408,7 +408,7 @@ class Labyrinthe extends Program{
return tab; return tab;
} }
void ajoutQuestion(String[][] file, int nbAjout){ //Permet d'ajouter nbAjout nouvelle Question void ajoutQuestion(String[][] file, int nbAjout, String cheminFichier){ //Permet d'ajouter nbAjout nouvelle Question
String[][] newFile = new String[length(file, 1) + nbAjout][length(file, 2)]; String[][] newFile = new String[length(file, 1) + nbAjout][length(file, 2)];
for(int i1 = 0; i1 < length(file, 1); i1 ++){ //copie le fichier de base for(int i1 = 0; i1 < length(file, 1); i1 ++){ //copie le fichier de base
for(int j1 = 0; j1 < length(file, 2); j1 ++){ for(int j1 = 0; j1 < length(file, 2); j1 ++){
...@@ -423,7 +423,7 @@ class Labyrinthe extends Program{ ...@@ -423,7 +423,7 @@ class Labyrinthe extends Program{
newFile[i][0]= intitu; newFile[i][0]= intitu;
newFile[i][1]= rep; newFile[i][1]= rep;
} }
saveCSV(newFile, "ressources/ListeQuestion.csv"); saveCSV(newFile, cheminFichier);
} }
...@@ -628,9 +628,8 @@ class Labyrinthe extends Program{ ...@@ -628,9 +628,8 @@ class Labyrinthe extends Program{
if(equals(toLowerCase(ques), "o")){ if(equals(toLowerCase(ques), "o")){
print("Combien voulez vous en ajouter ? : "); print("Combien voulez vous en ajouter ? : ");
int nbAjout = nbFromString(1); int nbAjout = nbFromString(1);
ajoutQuestion(questionTemp, nbAjout); ajoutQuestion(questionTemp, nbAjout, cheminFichier);
questionTemp = load(cheminFichier); questionTemp = load(cheminFichier);
afficheStringTab(questionTemp);
}else if(equals(toLowerCase(ques), "p")){ }else if(equals(toLowerCase(ques), "p")){
for(int i = 0; i<length(lab,1);i++){ for(int i = 0; i<length(lab,1);i++){
for(int j=0;j<length(lab,2);j++){ for(int j=0;j<length(lab,2);j++){
...@@ -645,6 +644,7 @@ class Labyrinthe extends Program{ ...@@ -645,6 +644,7 @@ class Labyrinthe extends Program{
int tailleLab = nbFromString(3); int tailleLab = nbFromString(3);
Salle[][] lab = genererLab(tailleLab); //genere le Layrinthe Salle[][] lab = genererLab(tailleLab); //genere le Layrinthe
String[][] tabScore = load("ressources/score.csv"); String[][] tabScore = load("ressources/score.csv");
print("Voulez vous ajouter des questions pour les monstres ? oui (o), non (autre) : "); print("Voulez vous ajouter des questions pour les monstres ? oui (o), non (autre) : ");
updateCSVQuestion(lab, "ressources/ListeQuestion.csv"); updateCSVQuestion(lab, "ressources/ListeQuestion.csv");
...@@ -653,7 +653,6 @@ class Labyrinthe extends Program{ ...@@ -653,7 +653,6 @@ class Labyrinthe extends Program{
Question[] lQuestion = listeQuestion("ressources/ListeQuestion.csv"); Question[] lQuestion = listeQuestion("ressources/ListeQuestion.csv");
Question[] lQuestionBoss = listeQuestion("ressources/ListeQuestionBoss.csv"); Question[] lQuestionBoss = listeQuestion("ressources/ListeQuestionBoss.csv");
print(readFile("ressources/img/Presentation.txt", true)); //affiche l'écran titre print(readFile("ressources/img/Presentation.txt", true)); //affiche l'écran titre
String lancer = readString(); String lancer = readString();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment