Beispiel #1
0
        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");
            }
        }
Beispiel #2
0
        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();
        }
Beispiel #3
0
        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);
        }
Beispiel #4
0
        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.");
            }
        }
Beispiel #5
0
        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);
        }