-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathPlanter.java
More file actions
36 lines (26 loc) · 780 Bytes
/
Copy pathPlanter.java
File metadata and controls
36 lines (26 loc) · 780 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import kareltherobot.*;
/**
* @author : D. Appel
*/
public class Planter extends Robot
{
//Instance variable used to store the array for beeper field
int[][]field;
public Planter(int st, int av, Direction dir, int numBeepers) {
super(st, av, dir, numBeepers);
}
public void setField(int[][]fieldSpecs) {
this.field = fieldSpecs;
}
public void plantField() {
}
public void printField() {
//Print out the beeperField to console
for(int row = 0; row < this.field.length; row++){
for(int col = 0; col < this.field[0].length; col++) {
System.out.print(this.field[row][col] + " ,");
}
System.out.println();
}
}
}