Okay, I noticed in your original code that the food data was kept in the matrix_data array, but that the print_matrix function used the trace_matrix for it's output. I assumed there was something we weren't seeing where you copied the matrix_data into the trace_matrix, tho that's not shown in the code snippet.
In other words, of course you don't see what we've done because our code filled matrix_data and your code prints trace_matrix. You've got so many matrix variables, is it possible you're confusing yourself? (And what in the world did you show us print_program function for?)