# Number Tile Game

`I am trying to make a tile game where you are supposed to put the numbers in order. So I couldn’t get the numbers into the last row and I trying to get them to move. There isn’t supposed to be a square on the bottom right corner so you and shift the squares(numbers).

``````int value=0;

int abc = 0;

int cols = 4;

int rows = 4;

int[][] myArray = new int[cols][rows];

void setup() {

size(400, 400);

background(255, 0, 0);

for (int i = 0; i &lt; cols; i++) {

for (int j = 0; j &lt; rows; j++) {

myArray[i][j] = abc++;

}

}

}

void draw()

{

for (int i = 0; i &lt; cols; i++)

{

for (int j = 0; j &lt; rows; j++)

{

fill(255);

rect(100*i, 100*j, 100, 100);

fill(0);

text(myArray[i][j], 100*i+20, 100*j-30);

}

}

}

void mouseReleased() {

}
``````

1 Like

some text what messed it up… like `&lt;`
pls post it again using the
code formatter

``````</>
``````

so we can copy and paste and run it here.
also a screen shot can help to understand the problem?

Srry about that. Here you go.

thanks, but your code is still damaged,
why you not try what we are supposed to do with it:

copy, paste in a new processing window and press run

but i think i found the problem:

``````      text(myArray[i][j], 100*i+20, 100*j+30);  // not -

``````

I already put it into processing and it works normally. But can you explain why it is the problem? I am not very good with arrays.

that was not a array problem ( that one is good ), but
when j == 0
you draw the text at -30 ( above canvas )
so you could have noticed that the numbers not start with “0”
( like first line missing // and not the last )

so…
your above first code still not run-able,
and you also not posted the new corrected code down here.