Home | Forums | What's new | Resources | |
A Few Saturn Programming Questions |
slinga - Feb 19, 2004 |
vreuzon | Feb 20, 2004 | |||||||
1. Random I use slRandom to get random FIXED in a range, as well as integer (see code below). When launched at init, slRandom gives the same result everytime . To get a really random number, I use something like illustrated in this pseudo-code:
Code:
Its call is needed only one time (probably at init time). The idea is that user action is an unpredicable action (slSynch also should, but it does not seem to be the case). code for FIXED and int in a (min-max) range :
Code:
2. I don't see how your algorithm is affected by the left/right or bottom/top collision. This said, are you sure you free the right thing (structure or pointer) ? |
antime | Feb 20, 2004 | |||
When you allocate your list elements, are you sure you init them correctly? C does not guarantee anything about the state of memory allocated with malloc. You didn't provide the code, but at a guess you're being allocated a previously used block of memory which still contains whatever was being stored there before. |