ignotuS1

2

May 8th, 2022
970
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. let size = prompt('Size of Elochka?')
  2. let a = 0;
  3. let b = 0;
  4. let c = 1;
  5. let d = size;
  6.  
  7. while (a < size) {
  8.     while (b < d) {
  9.         console.put(' ')
  10.         b = b + 1;
  11.     }
  12.     b = 0;
  13.     while (b < c) {
  14.         console.put('*')
  15.         b = b + 1;
  16.     }
  17.     b = 0;
  18.     c = c + 2;
  19.     a = a + 1;
  20.     d = d - 1;
  21.     console.put ('\n')
  22. }
  23.  
  24. a = 0;
  25. b = 0;
  26. c = 1;
  27. d = size;
  28.  
  29. while (a < size) {
  30.     while (b < d) {
  31.         console.put (' ')
  32.         b = b + 1;
  33.     }
  34.     b = 0;
  35.     while (b < c) {
  36.         console.put ('*')
  37.         b = b + 1;
  38.     }
  39.     b = 0;
  40.     a = a + 1;
  41.     c = c - 1;
  42. }
Advertisement
Add Comment
Please, Sign In to add comment