Skip to content

Instantly share code, notes, and snippets.

@clonn
Created October 6, 2024 06:04
Show Gist options
  • Save clonn/66b36bb3070648ca2c1920bb5caebe52 to your computer and use it in GitHub Desktop.
Save clonn/66b36bb3070648ca2c1920bb5caebe52 to your computer and use it in GitHub Desktop.
print a big eyes, how big you want ( . )( . )
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