From 93953a52ce96a5bd2bfd50f0b323f58901a711e8 Mon Sep 17 00:00:00 2001 From: loic Date: Thu, 22 Sep 2016 20:57:53 +0200 Subject: [PATCH] Add 2 and 4 --- src/main/java/adapter/ModelAdapter.java | 4 ---- src/main/java/model/Board.java | 20 ++++++++++++++++++++ 2 files changed, 20 insertions(+), 4 deletions(-) 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