예제 #1
0
        public string CreateDeathStory(DeathStory word)
        {
            string story = $" On {word.MurderTime}, a {word.Adverb} evening, I was leaving from \n" +
                           $"the {word.Place}. {word.Person} ran out in front of me and I {word.Verb} \n" +
                           $"him with a {word.Weapon}. Did they live? {word.Alive}. I was {word.Age} when this happened. " +
                           $"Shh, please don't tell anyone.";

            return(story);
        }
예제 #2
0
        private void PlayTheDeathStory()
        {
            DeathStory      newDeathStory = new DeathStory();
            DeathStory_Repo newDeathRepo  = new DeathStory_Repo();

            Console.WriteLine("Please enter an adverb: (example: quickly, softly, well)");
            newDeathStory.Adverb = Console.ReadLine();

            Console.WriteLine("Please enter a MurderTime: example: (1/28/2015) (m/d/year)");
            string dateAsString = Console.ReadLine();

            newDeathStory.MurderTime = DateTime.Parse(dateAsString);

            Console.WriteLine("Please enter a noun");
            newDeathStory.Noun = Console.ReadLine();

            Console.WriteLine("Please enter a person");
            newDeathStory.Person = Console.ReadLine();

            Console.WriteLine("Please enter a place");
            newDeathStory.Place = Console.ReadLine();

            Console.WriteLine("Please enter a verb");
            newDeathStory.Verb = Console.ReadLine();

            Console.WriteLine("Please enter a weapon");
            newDeathStory.Weapon = Console.ReadLine();

            Console.WriteLine("Please enter an age");
            string ageAsString = Console.ReadLine();

            newDeathStory.Age = int.Parse(ageAsString);

            Console.WriteLine("Are they alive? (y/n)");
            string aliveString = Console.ReadLine().ToLower();

            if (aliveString == "y")
            {
                newDeathStory.Alive = true;
            }
            else
            {
                newDeathStory.Alive = false;
            }

            Console.WriteLine(newDeathRepo.CreateDeathStory(newDeathStory));
        }