From 5f109a007255f52fcc76e52fae96a9b980f28ad8 Mon Sep 17 00:00:00 2001 From: dymik739 Date: Tue, 21 Mar 2023 22:29:04 +0200 Subject: [PATCH] fix a bug with parameter skipping and make code flow more readable --- labs/2/Main.java | 3 ++- labs/2/Matrix.java | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/labs/2/Main.java b/labs/2/Main.java index 3a0dcac..fdf47f5 100644 --- a/labs/2/Main.java +++ b/labs/2/Main.java @@ -26,7 +26,7 @@ public class Main { } else if (Objects.equals(args[p], "--offline")) { allow_networking = false; - p += 2; + p += 1; } else { matrix_file_name = args[p++]; @@ -67,6 +67,7 @@ public class Main { System.out.println("Original matrix:"); Matrix m = new Matrix(); m.init(raw_m); + m.print(); // transposing m.transpose(); diff --git a/labs/2/Matrix.java b/labs/2/Matrix.java index 76d9482..2462796 100644 --- a/labs/2/Matrix.java +++ b/labs/2/Matrix.java @@ -19,7 +19,6 @@ public class Matrix { } public void transpose() { - print(); if (this.m[0].length != this.m.length) { int new_h = this.m[0].length; int new_w = this.m.length;