Browse Source

90% + blue belt

3 changed files with 83 additions and 0 deletions
  1. 10 0
      js/04/css/style.css
  2. 3 0
      js/04/index.html
  3. 70 0
      js/04/js/script.js

+ 10 - 0
js/04/css/style.css

@@ -29,4 +29,14 @@
     justify-content: center;
     align-items: center;
     font-size: 30px;
+}
+.out4 {
+    width: 20%;
+    margin: 0 auto;
+    min-height: 600px;
+    display: flex;
+    flex-direction: column;
+    justify-content: center;
+    align-items: center;
+    font-size: 30px;
 }

+ 3 - 0
js/04/index.html

@@ -14,6 +14,9 @@
     <div class="wrap">
         <div class="out3"></div>
     </div> 
+    <div class="wrap">
+        <div class="out4"></div>
+    </div> 
     <script src="./js/script.js"></script>
 </body>
 </html>

+ 70 - 0
js/04/js/script.js

@@ -178,4 +178,74 @@ for (let i = 0; i < chessHeight; i++) {
              
      }
      out3.innerHTML += '\n';
+}
+//=====================================================================================================//
+
+//                                          Задание на синий пояс: Треугольник                         //
+
+let out4 = document.querySelector('.out4')
+for (let i = 0; i < 7; i++) {
+        if (i == 1) {
+                for (let k = 0; k < 5; k++) {
+                        out4.innerHTML += '. ';
+                }
+                for (let k = 0; k < 1; k++) {
+                        out4.innerHTML += '#';
+                }
+                for (let k = 0; k < 5; k++) {
+                        out4.innerHTML += '. ';
+                }
+        } else 
+        if (i == 2) {
+                for (let k = 0; k < 4; k++) {
+                        out4.innerHTML += '. ';
+                }
+                for (let k = 0; k < 3; k++) {
+                        out4.innerHTML += '#';
+                }
+                for (let k = 0; k < 4; k++) {
+                        out4.innerHTML += '. ';
+                } 
+        } else 
+        if (i == 3) {
+                for (let k = 0; k < 3; k++) {
+                        out4.innerHTML += '. ';
+                }
+                for (let k = 0; k < 5; k++) {
+                        out4.innerHTML += '#';
+                }
+                for (let k = 0; k < 3; k++) {
+                        out4.innerHTML += '. ';
+                } 
+        } else 
+        if (i == 4) {
+                for (let k = 0; k < 2; k++) {
+                        out4.innerHTML += '. ';
+                }
+                for (let k = 0; k < 7; k++) {
+                        out4.innerHTML += '#';
+                }
+                for (let k = 0; k < 2; k++) {
+                        out4.innerHTML += '. ';
+                } 
+        } else 
+        if (i == 5) {
+                for (let k = 0; k < 1; k++) {
+                        out4.innerHTML += '. ';
+                }
+                for (let k = 0; k < 9; k++) {
+                        out4.innerHTML += '#';
+                }
+                for (let k = 0; k < 1; k++) {
+                        out4.innerHTML += '. ';
+                } 
+        } else 
+        if (i == 6) {
+                
+                for (let k = 0; k < 11; k++) {
+                        out4.innerHTML += '#';
+                }
+                 
+        }
+        out4.innerHTML += '<br>'
 }