aboutsummaryrefslogtreecommitdiff
path: root/Week4/src/oo15loipe/AsciiArt.java
diff options
context:
space:
mode:
Diffstat (limited to 'Week4/src/oo15loipe/AsciiArt.java')
-rw-r--r--Week4/src/oo15loipe/AsciiArt.java13
1 files changed, 10 insertions, 3 deletions
diff --git a/Week4/src/oo15loipe/AsciiArt.java b/Week4/src/oo15loipe/AsciiArt.java
index cc4111b..3ee3367 100644
--- a/Week4/src/oo15loipe/AsciiArt.java
+++ b/Week4/src/oo15loipe/AsciiArt.java
@@ -11,21 +11,28 @@ package oo15loipe;
*/
public class AsciiArt implements TekenLoipe{
private InfoLoipe L;
+ private Punt man;
+
public AsciiArt(InfoLoipe s){
this.L = s;
+ this.man = new Punt(null);
}
@Override
public void setPosition(Punt p){
-
+ this.man = p;
}
/**
* draws the loipe by checking each fragment at (i,j) for its direction
*/
@Override
public void teken(){
- for(int i = 0; i < L.getX(); i++){
- for(int j = 0; j < L.getY(); j++){
+ for(int i = 0; i < L.getWidth(); i++){
+ for(int j = 0; j < L.getHeight(); j++){
+ if(i == man.getX() && j == man.getY()){
+ System.out.print('*');
+ break;
+ }
Fragment f = L.getFragment(i,j);
switch (f){
case KR: System.out.print('+'); break;