Add function for generating grids when given an instruction string and a grid constructor.