As far as execution speed, I'm not sure that this would make much of a difference, but would it be equivalent to replace lines 16 through 22 with:
Code:
while(c<8 && rack[c][b]==piece) c++;
Also, how fast is the pow function compared to say, an array that you make that just contains the correct number of points for a given length? This would also allow you not to use math.h.
Add:
Code:
int run_points[9]={0,0,4,8,16,32,64,128,256};
and then replace:
with
Code:
run_points[counter];
Edit:
-Corrected a couple of brackets.
-I've also written my own version of a score keeping program, though I'm sure it runs many times slower than yours because it does fun things like passing lots of structures by value. Depending on what your using it for though, performance might not really be an issue and you might want to take a look. See:
http://www.chiefdelphi.com/forums/sh...ad.php?t=51408