Code skill The Game Board

This piece of code creates the basic structure of your HTML page, on which you will build your game board using the <canvas> element. You will use an array to define the game board, creating walls and an island for the snake to move around. The forEach and split methods will check each character in the array to work out whether to draw a black square on-screen.

See the Pen GB1 M2 by Walker Books UK (@walkerbooks) on CodePen.