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); }
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); }
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); }
private void buttonEmpty_Click(object sender, EventArgs e) { grid = Grid.Empty(GridSize); CreatingNewGrid(); }