klansie:
Thanks, I haven't tried the code yet cause it says 'NUM_STATE' was not declared in this scope, What should I define NUM_STATE as ?
As UKHeliBob has pointed out, there is missing and "S" at the end, typo. There is also another brainfart, the line "i = state - 4" should have been "i = state - 5".