Problem Solving with Go course

GridsQuiz: Grids

Problem Solving with Go

Display

Theme

Grids · Quiz

Quiz: Grids

Check what you know about grids: rows and columns, neighbours and edges, points as map keys, simulations and rotating a grid. Answer every question below.

  1. Question 1 of 6A grid is stored as []string. The puzzle names the position (x=4, y=1). Which cell is it?
  2. Question 2 of 6Why is this condition safe even when r can be -1?
    if r >= 0 && r < len(grid) && grid[r][c] == '#' {
    	// ...
    }
  3. Question 3 of 6How many eight-way neighbours does the top-left cell of a 5×5 grid have?
  4. Question 4 of 6Which of these can be a map key in Go?
  5. Question 5 of 6In a simulation where every cell changes at once, what goes wrong if cells are changed in the grid you're reading?
  6. Question 6 of 6A grid of 3 rows × 7 columns is turned a quarter turn clockwise. What size is the result?