Last active
November 22, 2020 06:12
-
-
Save shalithasuranga/0ca72ad75047f00f654e295e70a61911 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const xSize = 50; | |
const ySize = 50; | |
const R = 10; | |
let output = ""; | |
for(let x = 0; x < xSize; x ++) { | |
for(let y = 0; y < ySize;y ++) { | |
if(Math.sqrt(Math.pow(x - xSize / 2, 2) + Math.pow(y - ySize / 2, 2)) <= R) | |
output += "**"; | |
else | |
output += " "; | |
} | |
output += "\n"; | |
} | |
console.log(output); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment