Beispiel #1
0
        public static Grid FourBridges(Size size)
        {
            Grid g = Grid.Empty(size);

            g.Bridges[1, 1] = g.Bridges[1, size.Height - 2] = g.Bridges[size.Width - 2, 1] = g.Bridges[size.Width - 2, size.Height - 2] = true;
            return(g);
        }
Beispiel #2
0
        public static Grid OneRing(Size size)
        {
            Grid g = Grid.Empty(size);

            for (int x = 1; x < g.Width - 1; x++)
            {
                g.Walls[2 * x + 1, 2] = true;
                g.Walls[2 * x + 1, g.Height *2 - 2] = true;
            }
            for (int y = 1; y < g.Height - 1; y++)
            {
                g.Walls[2, 2 * y + 1] = true;
                g.Walls[g.Width * 2 - 2, 2 * y + 1] = true;
            }
            return(g);
        }
Beispiel #3
0
        public static Grid FourWarps(Size size)
        {
            Grid g = Grid.Empty(size);

            if (g.Height % 2 == 1 && g.Width % 2 == 1)
            {
                g.Walls[g.Width, 0] = g.Walls[0, g.Width] = false;
            }
            else if (g.Height % 2 == 0)
            {
                g.Walls[0, g.Height - 3] = g.Walls[0, g.Height + 3] = false;
            }
            else if (g.Width % 2 == 0)
            {
                g.Walls[g.Height - 3, 0] = g.Walls[g.Width + 3, 0] = false;
            }

            return(g);
        }
Beispiel #4
0
 private void buttonEmpty_Click(object sender, EventArgs e)
 {
     grid = Grid.Empty(GridSize);
     CreatingNewGrid();
 }