View Single Post
  #3   Spotlight this post!  
Unread 10-01-2007, 16:37
mgreene mgreene is offline
Registered User
AKA: Mike Greene
FRC #1351 (TKO)
Team Role: Mentor
 
Join Date: Feb 2005
Rookie Year: 2003
Location: San Jose, CA
Posts: 12
mgreene is on a distinguished road
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.