Browse Source

HW<4> done

Illia Kozyr 2 years ago
parent
commit
1f2118cd3a
1 changed files with 28 additions and 35 deletions
  1. 28 35
      HW 4/homework4.html

+ 28 - 35
HW 4/homework4.html

@@ -8,21 +8,23 @@
     </head>
     <body>
         <table width="100%" border="1" cellspacing="0" cellpadding="4">
-            <caption>Таблица Пифагора</caption>
-             <tr>
-                 <th></th>
-                 <th>1</th>
-                 <th>2</th>
-                 <th>3</th>
-                 <th>4</th>
-                 <th>5</th>
-                 <th>6</th>
-                 <th>7</th>
-                 <th>8</th>
-                 <th>9</th>
-                 <th>10</th>
-             </tr>
-         </table>
+            <caption>
+                Таблица Пифагора
+            </caption>
+            <tr>
+                <th></th>
+                <th>1</th>
+                <th>2</th>
+                <th>3</th>
+                <th>4</th>
+                <th>5</th>
+                <th>6</th>
+                <th>7</th>
+                <th>8</th>
+                <th>9</th>
+                <th>10</th>
+            </tr>
+        </table>
         <script>
             // -------------------------html tree
             // let body = {
@@ -117,11 +119,8 @@
             // -------------------------while confirm
 
             // let cycleWhile = confirm();
-            // while (cycleWhile == false) {
+            // while (!cycleWhile) {
             //     cycleWhile = confirm();
-            //     if (cycleWhile) {
-            //         break;
-            //     }
             // }
 
             // -------------------------array fill
@@ -183,12 +182,11 @@
 
             // -------------------------chess one line
 
-            // debugger;
             // let lineWithResult = " ";
             // for(i = 0; i < 10; i++) {
-            //     if (i % 2) {
+
             //         lineWithResult = lineWithResult + " ";
-            //     } else {
+            //      if(i % 2 === 1) {
             //         lineWithResult = lineWithResult + "#";
             //     }
             // } console.log (lineWithResult);
@@ -196,20 +194,15 @@
             // -------------------------numbers
 
             // var c = "";
-            // for (let a = 0; a >= 0; a++) {
+            // for (let a = 0; a < 10; a++) {
             //     for (b = 0; b < 10; b++) {
             //         c = c + b;
             //         if (b == 9) {
             //             c = c + "\n";
             //         }
-
             //     }
-
-            //     if (a == 9) {
-            //         console.log(c);
-            //         break;
-            //     }
-            // }
+            // }console.log(c);
+            
 
             // -------------------------chess
 
@@ -252,11 +245,11 @@
 
             // -------------------------multiply table
 
-            // let arr = Array(10);
-            // for (let i = 1; i < 10; i++) {
-            //     arr[i] = [...Array(10)].map((_, j) => i * j);
-            // }
-            // console.log(arr[5][5]);
+            let arr = Array(10);
+            for (let i = 1; i < 10; i++) {
+                arr[i] = [...Array(10)].map((arr, j) => i * j);
+            }
+            console.log(arr[6][5]);
 
             // -------------------------matrix to html table