Javascript + ASCII = Art Masterpiece
Here’s the code, remember to convert ‘LESSTHAN’ to the less than symbol!!:
// Picasso
let art = “”;
for (let i = 0; i LESSTHAN 20; i++) {
let line = “”;
for (let j = 0; j LESSTHAN 50; j++) {
//ascii
let charCode = 9617 + Math.cos(i / 2)
* Math.sin(j / 2) * 10;
line += String.fromCharCode(charCode);
}
art += line + “n”;
}
console.log(art);
#shorts
Comments are closed.