From 6593c06eb9adb341968d6895308155b00b21c0fc Mon Sep 17 00:00:00 2001 From: theijligenberg Date: Thu, 26 Feb 2015 17:06:31 +0100 Subject: --- Week4/src/oo15loipe/AsciiArt.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'Week4/src/oo15loipe/AsciiArt.java') diff --git a/Week4/src/oo15loipe/AsciiArt.java b/Week4/src/oo15loipe/AsciiArt.java index cc4111b..07c73c1 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.getHeigth(); 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; -- cgit v1.2.3