public RapperTinder(List <RapperSwearStats> rappers, Song unknowsong) { this.rappers = rappers; this.unknowsong = unknowsong; var songSwearStats = new SwearStats(); songSwearStats.AddSwearsFrom(unknowsong); foreach (var rapper in rappers) { var score = rapper.CompareWith(songSwearStats); Console.WriteLine(rapper.name + ":" + score + "points"); } }
static void Main(string[] args) { var EminemSwearStats = new SwearStats(); var song = new Song("Eminem", "Rap god"); EminemSwearStats.AddSwearsFrom(song); var censor = new Censor(); Console.WriteLine(censor.Fix(song.lyric)); Console.ReadLine(); }
public int CompareWith(SwearStats eminemSwearStats) { int score = 0; foreach (var myword in przeklenstwa) { if (eminemSwearStats.przeklenstwa.ContainsKey(myword.Key)) { score++; } Console.WriteLine(myword.Key); } return(score); }
public RaperTinder(List <RapperSwearStats> rappers, Song unknowSong) { this.rappers = rappers; this.unknowSong = unknowSong; var songSwearStats = new SwearStats(); songSwearStats.AddSwearsFrom(unknowSong); foreach (var rapper in rappers) { var score = rapper.FindCommonSwearsScore(songSwearStats); Console.WriteLine(" " + rapper.name + "{0,50}", " " + score + " points."); } }
internal int FindCommonSwearsScore(SwearStats anotherStats) { int score = 0; foreach (var myWord in przeklenstwa) { if (anotherStats.przeklenstwa.ContainsKey(myWord.Key)) { score++; } // Console.WriteLine(myWord.Key); // else // score--; } return(score); }