Answers for "Javascript Chessboard grid"

0

Javascript Chessboard grid

size = 10; 
    
    grid = ""
    
    for (var i = 1; i <= size; i++) {
      for (var j = 1; j <= size; j++) {
        if (i % 2 === 0) {
        	grid+= "# "
        } else {
        	grid+= " #"
        }
      }
      grid+= "\n"
    }
    
    
    console.log(grid)
Posted by: Guest on August-17-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language