File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -88,8 +88,8 @@ class ShapeAlgorithm {
88
88
calculate ( ) {
89
89
// colorize all possible this.biggest_box.w * this.biggest_box.h items iterate
90
90
for ( let i = 0 ; i < this . matrix . length ; i += this . biggest_box . h ) {
91
- for ( let j = 0 ; j < this . matrix [ i ] . length ; j += this . biggest_box . w ) {
92
- if ( j >= this . window . w || i >= this . window . h || j + this . biggest_box . w >= this . window . w || i + this . biggest_box . h >= this . window . h ) break ;
91
+ for ( let j = 0 ; j < this . matrix [ 0 ] . length ; j += this . biggest_box . w ) {
92
+ if ( j > this . window . w || i > this . window . h || j + this . biggest_box . w > this . window . w || i + this . biggest_box . h > this . window . h ) break ;
93
93
94
94
this . labels [ `${ this . biggest_box . w } _${ this . biggest_box . h } ` ] = 1 ;
95
95
Original file line number Diff line number Diff line change @@ -14,19 +14,19 @@ <h1>Shapes Algorithm</h1>
14
14
< p > Enter numbers to see the result.</ p >
15
15
16
16
< label > Width of the main window:</ label >
17
- < input id ="window_width " type ="number " pattern ="[0-9]+ ">
17
+ < input id ="window_width " type ="number " pattern ="[0-9]+ " value =" 10 " >
18
18
< br >
19
19
20
20
< label > Height of the main window:</ label >
21
- < input id ="window_height " type ="number " pattern ="[0-9]+ ">
21
+ < input id ="window_height " type ="number " pattern ="[0-9]+ " value =" 10 " >
22
22
< br >
23
23
24
24
< label > Width of biggest box:</ label >
25
- < input id ="biggest_box_width " type ="number " pattern ="[0-9]+ ">
25
+ < input id ="biggest_box_width " type ="number " pattern ="[0-9]+ " value =" 2 " >
26
26
< br >
27
27
28
28
< label > Height of biggest box:</ label >
29
- < input id ="biggest_box_height " type ="number " pattern ="[0-9]+ ">
29
+ < input id ="biggest_box_height " type ="number " pattern ="[0-9]+ " value =" 5 " >
30
30
< br >
31
31
32
32
< button id ="button "> Preview</ button >
You can’t perform that action at this time.
0 commit comments