コード例 #1
0
ファイル: Form1.cs プロジェクト: mancala-friends/mancala
        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void createPits(object sender, EventArgs e)
        {
            rules = new Rules();
            int boardWidth = Mancala.Properties.Resources.board.Width;
            int pitWidth = Mancala.Properties.Resources.pit.Width;
            int xOffset = 110;
            int p1 = 1;
            int p2 = 2;

            pitPictureBoxes.Clear();
            pitPictureBoxes[p1] = createPlayerPits(xOffset, 175, Mancala.Properties.Resources.pit.Width + 10, p1);
            pitPictureBoxes[p1].Add(createPlayerStore(boardBox.Width - 100, 20, p1));
            pitPictureBoxes[p2] = createPlayerPits(boardWidth - pitWidth - xOffset, 20, -(pitWidth + 10), p2);
            pitPictureBoxes[p2].Add(createPlayerStore(10, 20, p2));
            setUpPits(pitPictureBoxes);

            render(rules.getGamestate());
        }
コード例 #2
0
ファイル: UnitTest1.cs プロジェクト: mancala-friends/mancala
        public void tryMoveTestFullGame()
        {
            //test to go again after landing in store
            Rules daRules = new Rules();

            while (!daRules.getGamestate().isOver())
            {
                int i = 0;
                while (!daRules.tryMove(i))
                {
                    i++;
                }
            }
        }