function chessBoard(size: number) {
  let output = "";
  let sizeV = size;

  for (let h = 1; h <= size; h++) {
    const isEven = h % 2 === 0;

    for (let v = 1; v <= sizeV; v++) {

      if (isEven) {
        output += v % 2 !== 0 ? "#" : " ";
      } else {
        output += v % 2 === 0 ? "#" : " ";
      }

      if (v === sizeV) output += "\n"
    }

  }

  console.log(output)
}

function chessBoardAthorSolution(size: number) {
  let board = "";

  for (let y = 0; y < size; y++) {
    for (let x = 0; x < size; x++) {
      if ((x + y) % 2 == 0)
        board += " ";
      else
        board += "#";
    }
    board += "\n";
  }

  console.log(board)

}

chessBoardAthorSolution(10);
