colorback (black)
cls
drawfillbox (600, 0, 600, 500, brightred)
var answer : string
var horsepic1 : int
var horsepic2 : int
var horsepic3 : int
horsepic1 := Pic.FileNew ("horse1.bmp")
horsepic2 := Pic.FileNew ("horse2.bmp")
horsepic3 := Pic.FileNew ("horse3.bmp")
var x1 : int := 50
var x2 : int := 50
var x3 : int := 50
var x4 : int := 50
var x5 : int := 50
var x6 : int := 50
var x7 : int := 50
var x8 : int := 50
loop
cls
x1 := 50
x2 := 50
x3 := 50
x4 := 50
x5 := 50
x6 := 50
x7 := 50
x8 := 50
drawfillbox (600, 0, 600, 500, brightred)
loop
drawfillbox (x1 - 10, 350, x1 + 32, 382, black)
drawfillbox (x2 - 10, 300, x2 + 32, 332, black)
drawfillbox (x3 - 10, 250, x3 + 32, 282, black)
drawfillbox (x4 - 10, 200, x4 + 32, 232, black)
drawfillbox (x5 - 10, 150, x5 + 32, 182, black)
drawfillbox (x6 - 10, 100, x6 + 32, 132, black)
drawfillbox (x7 - 10, 50, x7 + 32, 82, black)
drawfillbox (x8 - 10, 0, x8 + 32, 32, black)
Pic.Draw (horsepic1, x1, 350, picCopy)
Pic.Draw (horsepic1, x2, 300, picCopy)
Pic.Draw (horsepic1, x3, 250, picCopy)
Pic.Draw (horsepic1, x4, 200, picCopy)
Pic.Draw (horsepic1, x5, 150, picCopy)
Pic.Draw (horsepic1, x6, 100, picCopy)
Pic.Draw (horsepic1, x7, 50, picCopy)
Pic.Draw (horsepic1, x8, 0, picCopy)
delay (10)
Pic.Draw (horsepic2, x1, 350, picCopy)
Pic.Draw (horsepic2, x2, 300, picCopy)
Pic.Draw (horsepic2, x3, 250, picCopy)
Pic.Draw (horsepic2, x4, 200, picCopy)
Pic.Draw (horsepic2, x5, 150, picCopy)
Pic.Draw (horsepic1, x6, 100, picCopy)
Pic.Draw (horsepic1, x7, 50, picCopy)
Pic.Draw (horsepic1, x8, 0, picCopy)
delay (10)
Pic.Draw (horsepic3, x1, 350, picCopy)
Pic.Draw (horsepic3, x2, 300, picCopy)
Pic.Draw (horsepic3, x3, 250, picCopy)
Pic.Draw (horsepic3, x4, 200, picCopy)
Pic.Draw (horsepic3, x5, 150, picCopy)
Pic.Draw (horsepic1, x6, 100, picCopy)
Pic.Draw (horsepic1, x7, 50, picCopy)
Pic.Draw (horsepic1, x8, 0, picCopy)
delay (10)
Pic.Draw (horsepic3, x1, 350, picCopy)
Pic.Draw (horsepic3, x2, 300, picCopy)
Pic.Draw (horsepic3, x3, 250, picCopy)
Pic.Draw (horsepic3, x4, 200, picCopy)
Pic.Draw (horsepic3, x5, 150, picCopy)
Pic.Draw (horsepic1, x6, 100, picCopy)
Pic.Draw (horsepic1, x7, 50, picCopy)
Pic.Draw (horsepic1, x8, 0, picCopy)
delay (10)
Pic.Draw (horsepic3, x1, 350, picCopy)
Pic.Draw (horsepic3, x2, 300, picCopy)
Pic.Draw (horsepic3, x3, 250, picCopy)
Pic.Draw (horsepic3, x4, 200, picCopy)
Pic.Draw (horsepic3, x5, 150, picCopy)
Pic.Draw (horsepic1, x6, 100, picCopy)
Pic.Draw (horsepic1, x7, 50, picCopy)
Pic.Draw (horsepic1, x8, 0, picCopy)
delay (10)
Pic.Draw (horsepic3, x1, 350, picCopy)
Pic.Draw (horsepic3, x2, 300, picCopy)
Pic.Draw (horsepic3, x3, 250, picCopy)
Pic.Draw (horsepic3, x4, 200, picCopy)
Pic.Draw (horsepic3, x5, 150, picCopy)
Pic.Draw (horsepic1, x6, 100, picCopy)
Pic.Draw (horsepic1, x7, 50, picCopy)
Pic.Draw (horsepic1, x8, 0, picCopy)
delay (10)
x1 := x1 + Rand.Int (1, 10)
x2 := x2 + Rand.Int (1, 10)
x3 := x3 + Rand.Int (1, 10)
x4 := x4 + Rand.Int (1, 10)
x5 := x5 + Rand.Int (1, 10)
x6 := x6 + Rand.Int (1, 10)
x7 := x7 + Rand.Int (1, 10)
x8 := x8 + Rand.Int (1, 10)
exit when x1 >= 600 or x2 >= 600 or x3 >= 600 or x4 >= 600 or x5 >= 600 or x6 >= 600 or x7 >= 600 or x8 >= 600
end loop
color (10)
if x1 >= 600 then
put "Horse 1 Wins!"
elsif x2 >= 600 then
put "Horse 2 Wins!"
elsif x3 >= 600 then
put "Horse 3 Wins!"
elsif x4 >= 600 then
put "Horse 4 Wins!"
elsif x5 >= 600 then
put "Horse 5 Wins!"
elsif x6 >= 600 then
put "Horse 6 Wins!"
elsif x7 >= 600 then
put "Horse 7 Wins!"
elsif x8 >= 600 then
put "Horse 8 Wins!"
end if
put ""
locate (13, 10)
put "Press 'Y' to race again, press any key to exit"
get answer
exit when answer not= "y" and answer not= "Y"
end loop
cls
locate (13, 30)
put "Thankyou for playing!"
|