I was trying to write some code for my Gameboy with GBDK, and it errored
#include <gb/gb.h>
#include <gb/drawing.h>
UBYTE ship[10] =
{
{0, 0}
{2, 1}
{1, 1}
{2, 1}
{3, 1}
{1, 2}
{2, 2}
{3, 2}
{4, 2}
{0, 3}
}
void main()
{
int x, y;
for (x = 0; x < 9; x++)
{
color(BLACK, WHITE, SOLID);
plot_point(ship[x][0], ship[x][1]);
}
}
says there was a parse error before zero on line 10, and that code was not generated for ship because of previous errors at line 24. This is all in C, and again, I'm using the GBDK for this.
A friend told me I forgot commas, which I did...
#include <gb/gb.h>
#include <gb/drawing.h>
UBYTE ship[10] =
{
{0, 0},
{2, 1},
{1, 1},
{2, 1},
{3, 1},
{1, 2},
{2, 2},
{3, 2},
{4, 2},
{0, 3}
}
void main()
{
int x, y, i;
for (i = 0; i < 9; i++)
{
color(BLACK, WHITE, SOLID);
plot_point(ship[x][0], ship[x][1]);
}
}
Now the only error I get is at line 21. It says there was a parse error before void, but everything looks alright....
Sorry, it was midnight when I was posting
Sorry guys. Thanks for putting up with me in my worst.