Grid<E> implements a 2D grid structure in BRIDGES, and it can be used to represent 2D image like structures (more efficient than the 2D array representation for large arrays), as well as implementation of simple 2D games that operate on moderate sized grids. The setDimensions() method is used to set the grid dimensions. The ColorGrid subclass specializes this class to use Color for each grid element and is the subject of the illustrated example here. As before, <E> represents the generic class parameter. The Grid type uses a base64 representation for its contents.

Grid - Example BRIDGES Program - A checkerboard implementation using the ColorGrid)

Here's the final code:

Java
C++
Python

	  

	  

	  

Bridges Visualization

Well done! You’ve just created your Bridges Color Grid based Checker Board project!