Browse Source

fixed part of the HW4 done

AntonPyvovarov 1 year ago
parent
commit
2fe82d1790
1 changed files with 14 additions and 13 deletions
  1. 14 13
      HW4/main.js

+ 14 - 13
HW4/main.js

@@ -215,17 +215,18 @@
 
     // Задание на синий пояс: Треугольник,нужно еще пофиксить
 
-    // let i = 0,
-    //     j = 0;
-    // let point = "",
-    //     lattice = "";
-
-    // while (i < 5) {
-    //     point = "";
-    //     lattice = "";
-    //     for (j = 0; j < 5 - i; j++) point += ".";
-    //     for (j = 0; j < 2 * i + 1; j++) lattice += "#";
-    //     console.log(point + lattice + point);
-    //     i++;
-    // }
+    let i = 0,
+        j = 0;
+    let point = "",
+        lattice = "";
+
+    while (i <= 5) {
+        point = "";
+        lattice = "";
+        for (j = 0; j < 5 - i; j++) point += ".";
+        for (j = 0; j < 2 * i + 1; j++) lattice += "#";
+        console.log(point + lattice + point);
+        i++;
+    }
+    
 }