diff --git a/Axel/src/de/hs_mannheim/informatik/spreadsheet/Axel.java b/Axel/src/de/hs_mannheim/informatik/spreadsheet/Axel.java index 7de087e..fac0c3e 100644 --- a/Axel/src/de/hs_mannheim/informatik/spreadsheet/Axel.java +++ b/Axel/src/de/hs_mannheim/informatik/spreadsheet/Axel.java @@ -16,27 +16,31 @@ public class Axel { Scanner input = new Scanner(System.in); spr.put("A3", "123"); - spr.put("A2", "1"); - spr.put("B9", "=41+A2"); - spr.put("J5", "=7*6"); - spr.put("J6", "=3/2"); + spr.put("B9", "=41+A2+10-2/3"); System.out.println("Schreibe 'stop' zum anhalten."); do{ String command = ""; String form = ""; String cell= ""; + boolean cellTRUE = true; System.out.println(spr); System.out.println("Befehl (z.B. D4_=7*6): "); command = input.nextLine(); if(command.contentEquals("stop")) break; - for(int i = 3; i args = new ArrayList<>(); + + while (m.find()) { + if(!m.group().isEmpty()) { + if(isNumber(m.group())||isCar(m.group())) { + args.add(m.group()); + }else { + if(cells[getRow(m.group())][getCol(m.group())].getValue().isEmpty()) + args.add("0"); + else + args.add(m.group()); + } } } - - return res; + + for(int i = 2; i