From eee62c38c42ad6469017b4e9cb6d13d84f9a8edc Mon Sep 17 00:00:00 2001 From: selim Date: Wed, 27 Dec 2023 06:02:19 +0100 Subject: [PATCH] First version: 1.0 finished. --- Axel/resources/zahlen.csv | 14 +++-- .../informatik/spreadsheet/Axel.java | 19 ++++--- .../informatik/spreadsheet/Spreadsheet.java | 51 +++++++++++-------- 3 files changed, 54 insertions(+), 30 deletions(-) diff --git a/Axel/resources/zahlen.csv b/Axel/resources/zahlen.csv index 1ec60e0..6c59c73 100644 --- a/Axel/resources/zahlen.csv +++ b/Axel/resources/zahlen.csv @@ -1,4 +1,10 @@ -1,2 -3,4 -5,6 -7,8 +,,,,,,,,, +,,,,,,,,, +,,,,,,,,, +,,,,,,,,, +,,,,,,,,, +,,,,,,,,, +,,,,,,,,, +,,,,,,,,, +,,,,,,,,, +,,,,,,,,, diff --git a/Axel/src/de/hs_mannheim/informatik/spreadsheet/Axel.java b/Axel/src/de/hs_mannheim/informatik/spreadsheet/Axel.java index e9c4e46..e1be23a 100644 --- a/Axel/src/de/hs_mannheim/informatik/spreadsheet/Axel.java +++ b/Axel/src/de/hs_mannheim/informatik/spreadsheet/Axel.java @@ -15,14 +15,21 @@ public class Axel { System.out.println("\nAxel(ExcelFakeVon2211482): "); System.out.print("\nTabellengröße(ReihenZwischen1-99 SpaltenZwischen1-26): "); Spreadsheet spr = new Spreadsheet(sc.nextInt(), sc.nextInt()); - String help = "n"; + boolean stop = false; - while (true) { + while (!stop) { - System.out.println(spr); - System.out.println("\nHILFE (Für eine Anleitung.)\n"); - System.out.print("KOMMANDO: "); - spr.cellInput(); + try { + System.out.println(spr); + System.out.println("\nHILFE (Für eine Anleitung.)\n"); + System.out.print("KOMMANDO: "); + stop = spr.cellInput(); + } catch(Exception e){ + System.out.println("\nEingabe unzulässig!"); + System.out.println("\nEnter zum fortfahren."); + sc.nextLine(); + sc.nextLine(); + } } } diff --git a/Axel/src/de/hs_mannheim/informatik/spreadsheet/Spreadsheet.java b/Axel/src/de/hs_mannheim/informatik/spreadsheet/Spreadsheet.java index 9551e5a..04222ee 100644 --- a/Axel/src/de/hs_mannheim/informatik/spreadsheet/Spreadsheet.java +++ b/Axel/src/de/hs_mannheim/informatik/spreadsheet/Spreadsheet.java @@ -107,8 +107,8 @@ public class Spreadsheet { for(int i = 0; i < memList.size(); i++) memArr[i] = (memList.get(i)).split(String.valueOf(separator)); - for (int r = getRow(startCellName); r < memList.size(); r++) - for (int c = getCol(startCellName); c < memList.get(0).length(); c++) + for (int r = getRow(startCellName)-1; r < memList.size(); r++) + for (int c = getCol(startCellName)-1; c < memList.get(0).length(); c++) if(c