DEV Community

Obada
Obada

Posted on

JavaScript Challenge: Chessboard

What is the task:
Write a program that creates a string that represents an 8X8 grid,
using new line characters to separate lines. At each position of
the grid there is either a space or a # character. The characters
should form a chessboard.
passing this string to console.log should show something like
this:

Image description
When you have a program that generates this pattern, define a binding

size = 8 and change the program so that it works for any size, outputing a grid of the given size.
When you solve it, share on social media platforms with #challengewithubba

Top comments (0)