TEST YOURSELF

Have a go at fixing the code in the Codepen below! Remember to reference the Learn tab and the Pseudocode tab if you get stuck!

There are two parts which you need to fix, as indicated by the comments. Once you fix them you should have a simple noise output, much like the demo in the 'Introduction' sub-page in the Learn Section!

The first part is in the dot_prod_grid() function where you have to calculate the dot products. (line 27)

The second part is in the get() function where you have to interpolate some values together. (line 72)

See the Pen Perlin Noise - Test Yourself! by Ricky Hull (@rickym-h) on CodePen.