Hi guys I recently asked a similar question sorry about posting another thread I just have decided to start over because the thread was poorly explained and the title did not explain what the problem really was,
originally I thought the problem was random numbers not being generated but that does not seem to be the case,the problem seems to be that when my snake 'O' hits the food piece 'F' the hit does not get detected "HEY" never gets printed out
I tried using a debugger and setting break points but get a
Program received signal SIGTRAP, Trace/breakpoint trap. In ?? () () Cannot find bounds of current function Cannot find bounds of current function
In the draw() function i is the y-coordinate and j is the x-coordinate but when you compare them with the coordinates of the snake you have swapped them.
To avoid mistakes like this I would recommend naming the variables something more descriptive. i could be named y and j could be named x, and x and y could be named snakeX and snakeY which is more consistent with how you have named the coordinates for the fruit. If you don't want to rename the snake coordinates you could at least rename i and j as row and col (column).