diff --git a/src/main/java/adapter/ModelAdapter.java b/src/main/java/adapter/ModelAdapter.java index 1eac58a..35eba94 100644 --- a/src/main/java/adapter/ModelAdapter.java +++ b/src/main/java/adapter/ModelAdapter.java @@ -24,28 +24,24 @@ public class ModelAdapter implements IModelAdapter, IObservable{ @Override public void goUp() { model.goUp(); - model.addRandomNumber(); this.notifyObservers(); } @Override public void goDown() { model.goDown(); - model.addRandomNumber(); this.notifyObservers(); } @Override public void goLeft() { model.goLeft(); - model.addRandomNumber(); this.notifyObservers(); } @Override public void goRight() { model.goRight(); - model.addRandomNumber(); this.notifyObservers(); } diff --git a/src/main/java/model/Board.java b/src/main/java/model/Board.java index 8d1586d..87d8ef7 100644 --- a/src/main/java/model/Board.java +++ b/src/main/java/model/Board.java @@ -20,6 +20,8 @@ public class Board implements IModel{ } public void goUp() { + int [][] lastBoard=this.getCloneOfBoard(); + for(int i=0;i