
-----------------------------------
turing1094
Tue Jun 15, 2010 6:35 pm

could someone please comment this code for me
-----------------------------------
What is it you are trying to achieve?
My friend gave me this code to help me out but I dont understand it, could someone if not all comment some of it 


What is the problem you are having?
I dont understand any of it I am a beginner 

Describe what you have tried to solve this problem



Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)




setscreen ("graphics:v16,nocursor")
randomize
var wager, bank : int
var x1, x2, y1, y2, a1, a2, b1, b2, c1, c2, d1, d2, cc1, cc2, cc3, rad :
    int
var ball, choice : int
randint (rad, 20, 30)

x1 := 75
x2 := 100
y1 := maxy div 2 - 50
y2 := maxy div 2 + 50
a1 := 250
a2 := 275
b1 := maxy div 2 - 50
b2 := maxy div 2 + 50
c1 := 425
c2 := 450
d1 := maxy div 2 - 50
d2 := maxy div 2 + 50
cc1 := 4
cc2 := 9
cc3 := 14
bank := 10
colourback (255)
procedure drawcup1
    drawline (x1, y1, x2, y2, black)
    drawline (x2, y2, x2 + 60, y2, black)
    drawline (x2 + 60, y2, x2 + 85, y1, black)
    drawline (x1, y1, x2 + 85, y1, black)
    drawfill (x1 + 10, y1 + 1, cc1, black)
end drawcup1
procedure drawcup11
    drawline (x1, y1, x2, y2, 0)
    drawline (x2, y2, x2 + 60, y2, 0)
    drawline (x2 + 60, y2, x2 + 85, y1, 0)
    drawline (x1, y1, x2 + 85, y1, 0)
    drawfill (x1 + 10, y1 + 1, 0, 0)
end drawcup11

procedure drawcup2
    drawline (a1, b1, a2, b2, black)
    drawline (a2, b2, a2 + 60, b2, black)
    drawline (a2 + 60, b2, a2 + 85, b1, black)
    drawline (a1, b1, a2 + 85, b1, black)
    drawfill (a1 + 10, b1 + 1, cc2, black)
end drawcup2
procedure drawcup22
    drawline (a1, b1, a2, b2, 0)
    drawline (a2, b2, a2 + 60, b2, 0)
    drawline (a2 + 60, b2, a2 + 85, b1, 0)
    drawline (a1, b1, a2 + 85, b1, 0)
    drawfill (a1 + 10, b1 + 1, 0, 0)
end drawcup22

procedure drawcup3
    drawline (c1, d1, c2, d2, black)
    drawline (c2, d2, c2 + 60, d2, black)
    drawline (c2 + 60, d2, c2 + 85, d1, black)
    drawline (c1, d1, c2 + 85, d1, black)
    drawfill (c1 + 10, d1 + 1, cc3, black)
end drawcup3
procedure drawcup33
    drawline (c1, d1, c2, d2, 0)
    drawline (c2, d2, c2 + 60, d2, 0)
    drawline (c2 + 60, d2, c2 + 85, d1, 0)
    drawline (c1, d1, c2 + 85, d1, 0)
    drawfill (c1 + 10, d1 + 1, 0, 0)
end drawcup33

loop
    loop
        colour (white)
        locate (1, 1)
        put " You have $ ", bank, " in the bank."
        put " How much would you like to bet?: " ..
        get wager

        locate (1, 1)
        colour (white)
        put ""
        put ""
        exit when wager 