예제 #1
0
 public Elf(Scores s, int r)
 {
     scores           = s;
     currentScoreNode = scores.InsertRecipe(new List <int> {
         r
     });
 }
예제 #2
0
        private static Scores GenerateScores(int RecipeAfter)
        {
            Scores scores = new Scores();
            Elf    elf1   = new Elf(scores, 3);
            Elf    elf2   = new Elf(scores, 7);

            for (int rounds = 2; scores.NumberOfRecipes < RecipeAfter + 10; rounds++)
            {
                var        sum    = elf1.GetCurrentScore() + elf2.GetCurrentScore();
                List <int> values = sum.ToString().ToCharArray().Select(x => Int32.Parse(x.ToString())).ToList();
                scores.InsertRecipe(values);
                elf1.Move();
                elf2.Move();
            }

            return(scores);
        }