%Horseracing EvaluationHorseracing Assignment
%36 Marks
%This assignment requires you to develop a horseracing program. The program will
%allow the user to bet DOC dollars on the horse of their choice and win a bunch
%of cold hard DOC cash if their horse comes in first. This program will allow
%four rabid race fans to bet on one of six well-trained and extremely fast horses
%each. The program will look something like:
%Before the races starts you must ask each user how much DOC cash they have to
%start.
%For each race:
% get the bet from each user.
% display the bets, and current balance of each user.
% set-up arrays for the race
% run the actual race. (this is very similar to the dice example but
%on its side)
%pay whoever bet on the winning horse (if each horse has an equal chance of
%winning then you pay them 6 times their bet)
%After the race, the user with the most DOC dollars is the winner
%Evaluation
%/4 Setup Arrays /4 Looks
%/5 Advance Horses
%/5 Style /4 Make Bets
%/4 Pay Winner
%/10 Extras (odds, multiple races, intro, betting on place and show)
%View.Set ("graphics:max,max")
%var rollcount : array 1 .. 6 of int := init (0, 0, 0, 0, 0, 0)
%var die : int
%for i : 1 .. 10000
% randint (die, 1, 6)
% rollcount (die) := rollcount (die) + 1
% drawfillbox (die * 40, 0, die * 40 + 30, rollcount (die), die)
% drawline (0, 500, maxx, 500, red)
% delay (5)
% exit when rollcount (die) = 500
%end for
View.Set ("graphics:max,max")
var running : array 1 .. 4 of int := init (0, 0, 0, 0)
var run : int
var moneyBet : int
var moneyTotal : int
Pic.ScreenLoad ("Horse_Racing_Logo.jpg", 300, 590, picCopy) % Top Logo
Pic.ScreenLoad ("horse_red.jpg", 0, 0, picCopy) % Red Racer
Pic.ScreenLoad ("horse_blue.jpg", 0, 97, picCopy) % Blue Racer
Pic.ScreenLoad ("horse_gold.jpg", 0, 197, picCopy) % Gold Racer
Pic.ScreenLoad ("horse_silver.jpg", 0, 297, picCopy) % Silver Racer
Pic.ScreenLoad ("horse_purple.jpg", 0, 397, picCopy) % Purple Racer
Pic.ScreenLoad ("horse_orange.jpg", 0, 497, picCopy) % Orange Racer