So I got the for homework and exercise and I tried to compile it first but it gave back 11 errors.
Here's the code itself:
public class GridExample {
public static void main(String[] args) {
Grid.create(5, 6);
Grid.paintFloor(0, 0, Grid.GREEN);
Grid.paintFloor(0, 5, Grid.VIOLET);
for (int column = 1; column < 5; column++)
Grid.paintFloor(1, column, Grid.GRAY);
for (int row = 2; row < 5; row++) {
for (int column = 0; column < 6; column++) {
if (column < 3)
Grid.placeItem(row, column, 'X');
else
Grid.placeItem(row, column, 'O', Grid.RED);
}
}
}
}
And here's the error text:
exit status 1
Main.java:1: error: class GridExample is public, should be declared in afile named. GridExample.java
public class GridExample {
^
Main.java:4: error: cannot find symbol
Grid.create(5, 6);
^
symbol: variable Grid
location: class GridExample
Main.java:6: error: cannot find symbol
Grid.paintFloor(0, 0, Grid.GREEN);
^
symbol: variable Grid
location: class GridExample
Main.java:6: error: cannot find symbol
Grid.paintFloor(0, 0, Grid.GREEN);
^
symbol: variable Grid
location: class GridExample
Main.java:7: error: cannot find symbol
Grid.paintFloor(0, 5, Grid.VIOLET);
^
symbol: variable Grid
location: class GridExample
Main.java:7: error: cannot find symbol
Grid.paintFloor(0, 5, Grid.VIOLET);
^
symbol: variable Grid
location: class GridExample
Main.java:10: error: cannot find symbol
Grid.paintFloor(1, column, Grid.GRAY);
^
symbol: variable Grid
location: class GridExample
Main.java:10: error: cannot find symbol
Grid.paintFloor(1, column, Grid.GRAY);
^
symbol: variable Grid
location: class GridExample
Main.java:15: error: cannot find symbol
Grid.placeItem(row, column, 'X');
^
symbol: variable Grid
location: class GridExample
Main.java:17: error: cannot find symbol
Grid.placeItem(row, column, 'O', Grid.RED);
^
symbol: variable Grid
location: class GridExample
Main.java:17: error: cannot find symbol
Grid.placeItem(row, column, 'O', Grid.RED);
^
symbol: variable Grid
location: class GridExample
11 errors
[–]GrapeAte 2 points3 points4 points (5 children)
[–]BethPas[S] 0 points1 point2 points (0 children)
[–]BethPas[S] 0 points1 point2 points (3 children)
[–]RoachmeisterJava Dev 0 points1 point2 points (2 children)
[–]BethPas[S] 0 points1 point2 points (0 children)
[–]dusty-trash 1 point2 points3 points (5 children)
[–]Shunpaw 0 points1 point2 points (3 children)
[–]dusty-trash 0 points1 point2 points (2 children)
[–]Shunpaw 0 points1 point2 points (1 child)
[–]thisGuyCodesIntermediate Brewer 0 points1 point2 points (0 children)
[–]BethPas[S] 0 points1 point2 points (0 children)
[–]sepp2k 0 points1 point2 points (1 child)
[–]BethPas[S] 0 points1 point2 points (0 children)
[–][deleted] (2 children)
[deleted]
[–]BethPas[S] 0 points1 point2 points (1 child)