Created
October 6, 2024 06:04
-
-
Save clonn/66b36bb3070648ca2c1920bb5caebe52 to your computer and use it in GitHub Desktop.
print a big eyes, how big you want ( . )( . )
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
function printEyes(space = 2) { | |
// Determine if we should use dot or star based on space size | |
const symbol = space > 3 ? "*" : "."; | |
// Create one eye with proper spacing | |
const innerSpace = " ".repeat(space); | |
const eye = "(" + innerSpace + symbol + innerSpace + ")"; | |
// Combine both eyes | |
console.log(eye + eye); | |
} | |
// Example usage | |
printEyes(2); // ( . )( . ) | |
printEyes(3); // ( . )( . ) | |
printEyes(4); // ( * )( * ) | |
printEyes(5); // ( * )( * ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment