For my class I have to make the game snake. And I have the snake drawing with linked lists correctly and it all works pretty well except it draws everything way too fast.... By the way this is in C, not C++
So I need some sort of wait function... I found
void wait ( int seconds ){
clock_t endwait;
endwait = clock () + seconds * CLOCKS_PER_SEC ;
while (clock() < endwait) {}
}
on the site, but could not get it to work.And I included stdlib and time.h.
But im not that great of a programmer, so if someone could help me with this function I think I got the rest of the homework down.
then you'll want to make sure that CLOCKS_PER_SEC is valid
What? How could it not be valid? I guess if it was zero or negative, but the function should work for any positive value of CLOCKS_PER_SEC. And what the hell kind of implementation would have CLOCKS_PER_SEC<=0?
ICANSEEYOU7687: You are using Windows, right? Not Linux? Because that header, as its name suggests, only exists for Windows. Other than that, I don't know what could be failing. Every compiler for Windows except Cygwin comes with windows.h. Maybe you need to set your compiler search paths manually with Eclipse?