Advertisement
bacco

Christmas Hat

Mar 19th, 2018
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function number(inputData){
  2.    
  3.     var n = Number(inputData[0]);
  4.     var w = 4 * n + 1;
  5.     var h = 2 * n + 5;
  6.     h = h - 5;
  7.  
  8.     var a = (w - 3) / 2;
  9.    
  10.     console.log(`${".".repeat(a)}/|\\${".".repeat(a)}`);
  11.     console.log(`${".".repeat(a)}\\|/${".".repeat(a)}`);
  12.         b=-1;
  13.     for(var i = 0; i < h; i++) {
  14.         b++;
  15.         console.log(`${".".repeat(a--)}*${"-".repeat(b)}*${"-".repeat(b)}*${".".repeat(a + 1)}`);
  16.     }
  17.     console.log(`${"*".repeat(w)}`);
  18.     console.log(`*${".*".repeat(w / 2)}`);
  19.     console.log(`${"*".repeat(w)}`);
  20. }
  21.   //number(["4"])
  22.  
  23.  
  24. //             ......./|\.......
  25. //             .......\|/.......
  26. //             .......***.......
  27. //             ......*-*-*......
  28. //             .....*--*--*.....
  29. //             ....*---*---*....
  30. //             ...*----*----*...
  31. //             ..*-----*-----*..
  32. //             .*------*------*.
  33. //             *-------*-------*
  34. //             *****************
  35. //             *.*.*.*.*.*.*.*.*
  36. //             *****************
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement