Skip to content

Instantly share code, notes, and snippets.

@LuisRBarreras
Created December 18, 2019 23:02
Show Gist options
  • Save LuisRBarreras/6208e61287768d757265363c0be72343 to your computer and use it in GitHub Desktop.
Save LuisRBarreras/6208e61287768d757265363c0be72343 to your computer and use it in GitHub Desktop.
const gridSize = 8;
for(i=1; i <= gridSize; i++) {
let times = Math.floor(gridSize / 2);
if(i % 2 === 1) console.log(' *'.repeat(times))
else console.log('* '.repeat(times))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment