
-----------------------------------
rogerfrancis14
Thu Jun 01, 2006 3:58 pm

problem with random number
-----------------------------------
i have a small program with this program. i cannot find way to put in a number which is randomly chosen. pls help me. the program does not work when i put in a random number.



var m : int %value of random number
randint (m, 1, 100)

% The "Drag" program.
procedure DrawThemaple (x, y : int)
    var pic : int := Pic.FileNew ("Picture5.jpg") %getting the picture
    Pic.Draw (pic, 40 + x + m, 54 + y + m, picCopy)
    delay (50)
    var pic1 : int := Pic.FileNew ("Picture00.jpg")    %getting the picture
    Pic.Draw (pic1, 41 + x + m, 54 + y + m, picCopy)
end DrawThemaple


%drawing outline of the flag
drawmapleleaf (60, 280, 130, 360, 12)
drawbox (20, 280, 45, 360, 12)
drawbox (150, 280, 175, 360, 12)

var xBox : int := 0+m
var yBox : int := 0+m
var x, y, diffX, diffY, btn, updown : int
var buf : array 1 .. sizepic (0+m, 0+m, 40 + m, 40 + m) of int


takepic (xBox + m, yBox + m, xBox + m + 40, yBox + m + 40, buf) %record the pixel values

DrawThemaple (xBox + m, yBox + m)

for i : 1 .. 75

    if buttonmoved ("down") then
        buttonwait ("down", x, y, btn, updown)
        if (xBox + m) 