public string getRimique(Strophe strophe) { IList <Vers> versList = strophe.VersList; List <string> rimeList = new List <string>(); foreach (Vers ver in versList) { string rime = ver.Rime.GetRime; rimeList.Add(rime); } string rimique = null; /* Compare element (une rime) avec a,b,d,c correspondant a un schéma*/ /* Concatène la chaîne */ foreach (string element in rimeList) { if (element == a || a == null) { a = element; rimique += "A"; } else if (element == b || b == null) { b = element; rimique += "B"; } else if (element == c || c == null) { c = element; rimique += "C"; } else if (element == d || d == null) { d = element; rimique += "D"; } } return(rimique); }
/* Constructeur */ public Poeme(string name, int stropheNum) { stropheNumber = stropheNum; poemeName = name; Affichage menu = new Affichage(); stropheLength = menu.StropheLength(); stropheList = new Strophe[stropheNumber]; int i = 0; while (i < stropheNumber) { Strophe strophe = new Strophe(stropheLength, i); stropheList[i] = strophe; i++; } Console.WriteLine("Poeme crée"); }