@@ -16,12 +16,36 @@ private static String binaryFormString(int x, String binString) {
16
16
return binaryFormString (x / 2 , binString ) + (x % 2 );
17
17
}
18
18
19
+ public static void printTwoDmBooleanArray (boolean [][] theArray ) {
20
+ for (boolean [] row : theArray ) {
21
+ for (boolean column : row ) {
22
+ if (column ) {
23
+ System .out .print ("*" );
24
+ } else {
25
+ System .out .print (" " );
26
+ }
27
+ }
28
+ System .out .println ();
29
+ }
30
+ }
31
+
19
32
public static void main (String [] args ) {
20
33
double testX = 0.1 ;
21
34
double testY = 0.5 ;
22
35
23
- System . out . println ( isBetweenZeroAndOne ( testX , testY )) ;
36
+ boolean [][] testTwoDmBooleanArray = new boolean [ 3 ][ 2 ] ;
24
37
38
+ testTwoDmBooleanArray [0 ][0 ] = true ;
39
+ testTwoDmBooleanArray [0 ][1 ] = false ;
40
+ testTwoDmBooleanArray [1 ][0 ] = false ;
41
+ testTwoDmBooleanArray [1 ][1 ] = true ;
42
+ testTwoDmBooleanArray [2 ][0 ] = true ;
43
+ testTwoDmBooleanArray [2 ][1 ] = false ;
44
+
45
+ System .out .println (isBetweenZeroAndOne (testX , testY ));
25
46
System .out .println (toBinaryString (8 ));
47
+ System .out .println ();
48
+
49
+ printTwoDmBooleanArray (testTwoDmBooleanArray );
26
50
}
27
51
}
0 commit comments