For creation of grid points, I set the grid space to 200 x 200, which can be adjusted in the code as necessary. Then, to vary the grid points based on the length and width, I created sliders for them and linked them to x and y coordinates. I let the Z-coordinate be default at zero. For the cuboid, I set each of these grid points as the origin and the length and width from before as the cuboid’s dimensions.
I used the integer sliders for x and y ordinates of the ripple point as mentioned. And I used the sinusoidal function in the instructions for determining the height of the cuboids. For the five variables required for the calculation of height, I set amplitude and number of waves as independent factors. To satisfy the condition that base height should be greater than amplitude, I set it 0.1 greater than amplitude. The distance and max distance by using the CubeDistance function and then choosing the maximum of the list of distances.