I am trying to understand a C++ snake program I encounted on the net and can't seem to understand the following line: for (int i=0;i<(speed*pause_length);i++) int j=1+i
I understand what the loop is doing, but I don't understand how it controls the speed of the game. pause_length is a const variable set to 500000 and speed is set at 80. How does this control the speed of the game?
It is an old technique to delay by simply doing a loop for a while. This worked on older computers (like the 8086) where it was slow enough for such things to make sense. These days, it does not.