fork download
  1. #include <stdio.h>
  2.  
  3. struct date
  4. {
  5. int month;
  6. int day;
  7. int year;
  8. };
  9.  
  10. struct time
  11. {
  12. int hour;
  13. int minute;
  14. int second;
  15. };
  16.  
  17. struct name
  18. {
  19. char firstName[20];
  20. char middleInitial; // not always used
  21. char lastName[20];
  22. };
  23.  
  24. struct stats_record
  25. {
  26. int starts; // total for horse or jockey, not always used
  27. int wins; // total for horse or jockey
  28. int places; // total for horse or jockey
  29. int shows; // total for horse or jockey
  30. };
  31.  
  32. struct statistics
  33. {
  34. struct name statsName; // name of trainer or jockey
  35. struct stats_record startWinPlaceShow;
  36. };
  37.  
  38. struct win_place_show
  39. {
  40. char winName[20];
  41. int winNumber;
  42. char placeName[20];
  43. int placeNumber;
  44. char showName[20];
  45. int showNumber;
  46. };
  47.  
  48. struct race_condition
  49. {
  50. float purse; // prize money
  51. char detailedRaceDesc[100];
  52. char restriction [20]; // age restriction/condition
  53. char weightAssignments[10];
  54. char claimingCondition[80];
  55. char raceDistance[20]; // example: "Seven Furlongs"
  56. };
  57.  
  58. struct track_record_holder
  59. {
  60. char horsesName[20];
  61. int horsesAge;
  62. int weightCarried; // lbs
  63. struct time horsesTime;
  64. struct stats_record recordHoldersRaceRecord;
  65. };
  66.  
  67. struct medication_equipment
  68. {
  69. char medicationCode; // L for Lasix
  70. char equipmentCode; // g for goggles
  71. };
  72.  
  73. struct horse_info
  74. {
  75. char horseColor[2]; // b for bay, bl for black
  76. char horseGender; // c for colt, m for mare
  77. int horseAge;
  78. char sire[20]; // father
  79. char dam[20]; // mother
  80. };
  81.  
  82. struct totals
  83. {
  84. char totalsCategory[12]; // 2024, Life, AllWeather, Dirt, etc
  85. struct stats_record totalStats; // starts, wins, place, show
  86. int speedFigure;
  87. int earnings; // whole dollar amounts
  88. };
  89.  
  90. struct track_and_race
  91. {
  92. char trackCode[3]; // short for name of racetrack
  93. int raceNumber;
  94. };
  95.  
  96. struct final_position
  97. {
  98. int place;
  99. float lengths; // fractional, lengths behind leader or lengths in front
  100. };
  101.  
  102. struct finisher
  103. {
  104. char horseName[20];
  105. int weightCarried;
  106. float lengths; // fractional, lengths behind next position when crossing finish
  107. };
  108.  
  109. struct past_race
  110. {
  111. struct date raceDate; // item 16
  112. struct track_and_race trackRace; // item 17
  113. char trackCondition[4]; // item 18, GD for Good, FIRM for Firm
  114. float raceDistance; // item 20, in furlongs or miles (sometimes not whole like 1.70)
  115. int daysUnraced; // item 21
  116. struct time fractionalTimes[2]; // item 22
  117. char ageRestrictionLimit[3]; // item 23, stored as 2 characters for an age, and 1 character to denote R or L
  118. int restrictedToFillies; // item 24, flag
  119. int restrictedToStateBredHorses; // item 25, flag
  120. char raceType[3]; // item 26, eg: Mst for maiden stakes
  121. int equibasePaceFigures; // item 27
  122. int speedFigure; // item 28
  123. int postPostion; // item 29
  124. float pointCalls[2]; // item 30, fractional
  125. struct final_position finalPosition; // item 31
  126. struct name jockeyName; // item 32
  127. int weightCarried; // item 33
  128. struct medication_equipment medEquip; // item 34
  129. float finalOdds; // item 35
  130. struct finisher topThree[3]; // item 36
  131. char shortFootnotes[30]; // item 37
  132. int numberOfHorses; // item 38
  133. };
  134.  
  135. struct claiming_information
  136. {
  137. struct name newOwner;
  138. struct name previousOwner;
  139. int claimingPrice; // whole dollars
  140. struct name formerTrainer;
  141. };
  142.  
  143. struct workout_lines
  144. {
  145. struct date workoutDate;
  146. char racetrackName[3]; // assuming all track names are shortened to 3 chars
  147. int trackDistance; // in furlongs
  148. char trackCondition[4]; // GD for Good, FIRM for Firm
  149. struct time workoutTime;
  150. int breezing; // 1 if breezing, 0 if handily
  151. char rank[5]; // xx out of yy, seperated by a slash char
  152. };
  153.  
  154. // main structure to store details on each race
  155.  
  156. struct race_details
  157. {
  158.  
  159. struct date raceDate; // A - the date of the race
  160. int raceNumber; // C - the specific race number identifier
  161. char trackName[50]; // E - the name of the track where the race was held
  162. int raceRating; // G - the earning estimate for the race winner
  163. struct win_place_show notes; // H - notes area for the top 3 horses in the race
  164. char raceType[3]; // I - the type of race (eg: maiden claiming is mcl)
  165. struct race_condition condition; // J - the conditions of the race
  166. struct track_record_holder trackRecord; // K - info about the track record holding horse
  167.  
  168. };
  169.  
  170. // main structure to store details on each horse
  171.  
  172. struct horse_details_and_past_performance
  173. {
  174.  
  175. int programNumber; // 1 - the number of the horse being bet on
  176. char saddleClothColor[12]; // 2 - the color of cloth
  177. char morningLineOdds[3]; // 3 - the final assigned odds when the horse leaves the post
  178. int claimingPrice; // 4 - the horses sale price (whole dollars assumed)
  179. char owner[50]; // 5 - the owner of the horse
  180. char silks[50]; // 6 - the jockey jacket color
  181. struct statistics trainer; // 7 - the trainer name and info (starts, wins, places, shows)
  182. char horseName[20]; // 8 - the name of the horse
  183. struct medication_equipment medEquip; // 9 - the medication and equipment used by the horse
  184. struct horse_info horsesInfo; // 10 - the color, gender, age, sire, and dam
  185. int weightCarried; // 11 - the weight carried by the horse (lbs)
  186. struct statistics jockey; // 12 - the jockey name and info (starts, wins, places, shows)
  187. int horseClassFigure; // 13 - the estimate of what the starter will earn
  188. struct totals totalsGeneral[4]; // 14 - basic prior race stats
  189. struct totals totalsEnvironmental[4]; // 15 - basic prior race stats
  190. struct past_race priorRaceStats[5]; // 16-38 - detailed prior race information
  191. struct claiming_information claimInfo; // 39 - new and previous owner info
  192. struct workout_lines workoutLines[4]; // 40 - insight into the horses fitness and readiness
  193.  
  194. };
  195.  
  196. int main ( )
  197. {
  198.  
  199. // declare structs to test compile
  200. struct race_details myRaces[10];
  201. struct horse_details_and_past_performance myHorses[20];
  202.  
  203. return (0);
  204. };
Success #stdin #stdout 0.01s 5292KB
stdin
Standard input is empty
stdout
Standard output is empty