コード例 #1
0
ファイル: Program.cs プロジェクト: nassan/mastermind
        public Manager(Random rnd)
        {
            possibilities = new ArrayList();

            //Create the possibilities
            for (int i = 0; i < 6; i++)
            {
                for (int j = 0; j < 6; j++)
                {
                    for (int k = 0; k < 6; k++)
                    {
                        for (int l = 0; l < 6; l++)
                        {
                            Slot[] to_send = new Slot[4];
                            to_send[0] = new Slot(i);
                            to_send[1] = new Slot(j);
                            to_send[2] = new Slot(k);
                            to_send[3] = new Slot(l);

                            possibilities.Add(new Row(to_send));

                        }

                    }

                }

            }
            //Finished creating possiblities

            //Choose an answer for the guesser to guess

            answer = (Row)possibilities[rnd.Next(possibilities.Count)];
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: nassan/mastermind
 public Row(Slot[] peg_list)
 {
     white_pins = 0;
     black_pins = 0;
     this.row = peg_list;
 }