aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore2
-rw-r--r--Week4/src/no.pngbin0 -> 3662 bytes
-rw-r--r--Week4/src/nw.pngbin0 -> 3646 bytes
-rw-r--r--Week4/src/nz.pngbin0 -> 199 bytes
-rw-r--r--Week4/src/nzow.pngbin0 -> 214 bytes
-rw-r--r--Week4/src/oo15loipe/AsciiArt.java13
-rw-r--r--Week4/src/oo15loipe/InfoLoipe.java10
-rw-r--r--Week4/src/oo15loipe/LoipePlaatje.java6
-rw-r--r--Week4/src/ow.pngbin0 -> 3273 bytes
-rw-r--r--Week4/src/zo.pngbin0 -> 3662 bytes
-rw-r--r--Week4/src/zw.pngbin0 -> 3641 bytes
11 files changed, 20 insertions, 11 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..14b2b65
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,2 @@
+/Week4/nbproject/private/
+/Week4/build/ \ No newline at end of file
diff --git a/Week4/src/no.png b/Week4/src/no.png
new file mode 100644
index 0000000..daaec27
--- /dev/null
+++ b/Week4/src/no.png
Binary files differ
diff --git a/Week4/src/nw.png b/Week4/src/nw.png
new file mode 100644
index 0000000..2699df3
--- /dev/null
+++ b/Week4/src/nw.png
Binary files differ
diff --git a/Week4/src/nz.png b/Week4/src/nz.png
new file mode 100644
index 0000000..c4eeb9c
--- /dev/null
+++ b/Week4/src/nz.png
Binary files differ
diff --git a/Week4/src/nzow.png b/Week4/src/nzow.png
new file mode 100644
index 0000000..96ab874
--- /dev/null
+++ b/Week4/src/nzow.png
Binary files differ
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;
diff --git a/Week4/src/oo15loipe/InfoLoipe.java b/Week4/src/oo15loipe/InfoLoipe.java
index 764e2f3..1796418 100644
--- a/Week4/src/oo15loipe/InfoLoipe.java
+++ b/Week4/src/oo15loipe/InfoLoipe.java
@@ -10,10 +10,10 @@ package oo15loipe;
* @author cstaps
*/
public interface InfoLoipe {
- public int getWidth(); // grootte in oost−west ri c h ti n g
- public int getHeight(); // grootte in noord−zuid ri c h ti n g
- public Fragment getFragment(int x, int y); // fragment van de l oi p e op p o si ti e (x , y)
- public Punt start(); // Het startpunt op de kaart
- public Punt stap(); // het volgende punt op de route
+ public int getWidth( ) ; // grootte in oost􀀀west r i cht ing
+ public int getHeight( ) ; // grootte in noord􀀀zuid r i cht ing
+ public Fragment getFragment( int x, int y) ; // fragment van de loipe op po s i t i e (x , y)
+ public Punt start( ) ; // Het startpunt op de kaart
+ public Punt stap( ) ; // het volgende punt op de route
}
diff --git a/Week4/src/oo15loipe/LoipePlaatje.java b/Week4/src/oo15loipe/LoipePlaatje.java
index 3166309..db70d28 100644
--- a/Week4/src/oo15loipe/LoipePlaatje.java
+++ b/Week4/src/oo15loipe/LoipePlaatje.java
@@ -37,13 +37,13 @@ public class LoipePlaatje extends JFrame implements TekenLoipe
/**
* previous position for walking the loipe
*/
- private Point previousPos = null;
+ private Punt previousPos = null;
/**
* Constructor. Fill all icons.
*/
public LoipePlaatje(InfoLoipe s) {
- super("Kaart");
+ super("Loipe");
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
nz = plaatje("nz");
ow = plaatje("ow");
@@ -177,7 +177,7 @@ public class LoipePlaatje extends JFrame implements TekenLoipe
}
@Override
- public void setPosition(Point p) {
+ public void setPosition(Punt p) {
Graphics g = panel.getGraphics();
if (previousPos != null) {
g.setColor(SNOW);
diff --git a/Week4/src/ow.png b/Week4/src/ow.png
new file mode 100644
index 0000000..8d35019
--- /dev/null
+++ b/Week4/src/ow.png
Binary files differ
diff --git a/Week4/src/zo.png b/Week4/src/zo.png
new file mode 100644
index 0000000..1b578c0
--- /dev/null
+++ b/Week4/src/zo.png
Binary files differ
diff --git a/Week4/src/zw.png b/Week4/src/zw.png
new file mode 100644
index 0000000..702e57d
--- /dev/null
+++ b/Week4/src/zw.png
Binary files differ