コード例 #1
0
        static void Main(string[] args)
        {
            Grue  grue  = new Grue();
            Usine usine = new Usine(grue, new[] { 2, 1, 0, 3, 1, 8, 1 });

            Vue.Draw(grue, usine);

            do
            {
                if (usine.ExecuterAction(Solve(grue.Position, usine.Stacks, grue.IsGrabbing)))
                {
                    break;
                }
                Vue.Draw(grue, usine);
            }while (Console.ReadKey().KeyChar != 'q');
        }
コード例 #2
0
ファイル: Vue.cs プロジェクト: fdrobidoux/GrueChallenge
        private static void DrawGrue(Grue grue, Usine usine)
        {
            string espacementsInitiaux = "";

            for (int i = 0; i < grue.Position; i++)
            {
                espacementsInitiaux += ESPACEMENT;
            }

            espacementsInitiaux += (grue.IsGrabbing ? GRUE_GRAB : GRUE_VIDE);

            for (int i = grue.Position; i < usine.Stacks.Length; i++)
            {
                espacementsInitiaux += ESPACEMENT;
            }

            Console.SetCursorPosition(0, 0);
            Console.Write(espacementsInitiaux);
        }
コード例 #3
0
ファイル: Vue.cs プロジェクト: fdrobidoux/GrueChallenge
 public static void Draw(Grue grue, Usine usine)
 {
     DrawGrue(grue, usine);
     DrawBoxes(usine);
 }