Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function catFoodMeow(input) {
- let n = Number(input);
- let output = '.'.repeat(n - 1) + '|' + `${'\\/'.repeat(n)}` + `|${'.'.repeat(n - 1)}\n`
- + `${'.'.repeat(n - 1)}|` + `${'~'.repeat(2 * n)}` + `|${'.'.repeat(n - 1)}\n`;
- for (let i = 1; i <= n; i++) {
- output += `${'.'.repeat(n - 1)}|${' '.repeat(i - 1)}`;
- for (let j = n; j >= i; j--) {
- output += '{}';
- }
- output += `${' '.repeat(i - 1)}|${'.'.repeat(n - 1)}\n`;
- }
- output += `${'.'.repeat(n - 1)}|${' '.repeat(n - 2)}` + `MEOW${' '.repeat(n - 2)}|${'.'.repeat(n - 1)}\n`
- + `${'.'.repeat(n - 1)}|${' '.repeat(n - 2)}` + `FOOD${' '.repeat(n - 2)}|${'.'.repeat(n - 1)}\n`;
- for (let i = 1; i <= n; i++) {
- output += `${'.'.repeat(n - 1)}|${' '.repeat(n - i)}`;
- for (let j = 1; j <= i; j++) {
- output += '{}';
- }
- output += `${' '.repeat(n - i)}|${'.'.repeat(n - 1)}\n`;
- }
- output += `${'.'.repeat(n - 1)}|` + `${'~'.repeat(2 * n)}` + `|${'.'.repeat(n - 1)}\n`
- + `${'.'.repeat(n - 1)}|` + `${'\\/'.repeat(n)}` + `|${'.'.repeat(n - 1)}`;
- console.log(output);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement