This repository was archived by the owner on Feb 29, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +29
-1
lines changed Expand file tree Collapse file tree 1 file changed +29
-1
lines changed Original file line number Diff line number Diff line change @@ -309,8 +309,23 @@ public static long ffib(long n){
309309 return fibmem .get ((int ) n );
310310 }
311311 }
312+ public static void print () {
313+ System .out .println ();
314+ }
312315 public static void setupfib () {
313316 fibmem .add ((long ) 0 );fibmem .add ((long )1 );fibmem .add ((long )1 );fibmem .add ((long )2 );
317+ }
318+ public static void show2Darr (int [][] a ) {
319+ for (int [] b :a ) {
320+ for (int c :b ) {
321+ print (c +" " ,"" );
322+ }
323+ print ();
324+
325+ }
326+ }
327+ public static void showarr (int [] a ) {
328+ for (int x :a ) {print (x +" " );}
314329 }
315330 public static void main (String [] args ) throws Exception {
316331 /*
@@ -321,9 +336,22 @@ public static void main(String[] args) throws Exception{
321336 */
322337 System .out .println ("Running demo" );
323338 Scanner sc =getsysscan ();
324- print ("Welcome to the demo\n You have many choices \n 1} Run help \n \n 2}Run demo to see features " );
339+ print ("Welcome to the demo" );
325340 print (">" ,"" );
326341 int val ;
342+ int [][] testarray = {
343+ {1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 },
344+ {1 ,1 ,1 ,0 ,0 ,1 ,1 ,2 },
345+ {0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 },
346+ {0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 },
347+ {0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 },
348+ {1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 },
349+ {1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 },
350+ };
351+ print ("Roation of 90 degrees\n Before \n \n \n \n " );
352+ show2Darr (testarray );
353+ print ("After \n " );
354+ show2Darr (rotate90cw (testarray ));
327355 try {
328356 val =sc .nextInt ();
329357 }catch (Exception e ) {
You can’t perform that action at this time.
0 commit comments