|
Re: Scoring function in C
Sounds about right, and perhaps the commenting leaves something to be desired.
int score(char piece)
returns the (integer) score of a particular team(passed as a char, "piece").
char rack[][] contains character "pieces" (X's and O's, if you like)
MG
(spoilers actually score correctly, but only because their char (piece) would be different from that passed to the function on the call)
Last edited by mgreene : 10-01-2007 at 16:50.
|