A bit of neat logic I just came up with while working on my collision detection.
The following code, with assistance from a three slot array, records the last value of an int so if you wish to test for a condition which occurred before the current one use this code:
// Array Deceleration
int Feedback[3] = { ( 0, 0, 0 ) } ;
// Code
if ( Feedback[0] != Feedback[1] ) { Feedback[2] = Feedback[1] ; }
Feedback[1] = Feedback[0] ;
// Status Recording
See the three numbers on the left hand side of the screen shot for a display of the feedback variable. The top value is the current status marker (Feedback 0), the second is the recording varible (Feedback 1) and the last is the previous condition record (Feedback 2).
/Ludo
We are here and it is now.