Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 some colorful procedure
Index -> Programming, Turing -> Turing Submissions
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Homer_simpson




PostPosted: Mon May 12, 2003 2:15 am   Post subject: some colorful procedure

code:

procedure changepicture (x1, y1, x2, y2, c, p : int)
    var ii := 0
    randint (ii, 1, 255)
    for xx : x1 .. x2
        for yy : y1 .. y2
            if whatdotcolor (xx, yy) not= c then
                case p of
                    label 1 :
                        drawdot (xx, yy, ii)
                    label 2 :
                        if whatdotcolor (xx, yy) > 26 then
                            drawdot (xx, yy, (whatdotcolor (xx, yy) mod 16) + 16)
                            locate (1, 1)
                            put "jazz"
                        elsif whatdotcolor (xx, yy) < 16 then
                            drawdot (xx, yy, (whatdotcolor (xx, yy) mod 16) + 16)
                            locate (2, 1)
                            put "jazz"
                        end if

                    label 3 :
                        var i := 0
                        randint (i, 1, 255)
                        drawdot (xx, yy, i)
                    label 4 :
                        var i := 0
                        randint (i, 16, 28)
                        drawdot (xx, yy, i)
                    label :
                end case
            end if
        end for
    end for
end changepicture


var i := 0
View.Set ("offscreenonly")
loop
    i += 10
    drawfillarc (320, 200, 50, 50, i, i + 90, 9)
    changepicture (270, 150, 320, 200, white, 1)
    changepicture (270, 200, 320, 250, white, 3)
    changepicture (320, 200, 370, 250, white, 4)
    drawbox (270, 150, 370, 250, black)
    View.Update
    cls
end loop
Sponsor
Sponsor
Sponsor
sponsor
Homer_simpson




PostPosted: Mon May 12, 2003 2:34 am   Post subject: (No subject)

k here's how it workes x1,y1,x2,y2 obviously set the area to be edited by procedure. parameter c is the background color. parameter p is the action to be performed the actions are

the value of p=1 change the color randomly
the value of p=2 turn the image black and white
the value of p=3 turn the image to black and white statics
the value of p=4 turn image to full color statics

(try turning a bmp black and white...)
Homer_simpson




PostPosted: Mon May 12, 2003 2:41 am   Post subject: (No subject)

download


some color procedure.zip
 Description:

Download
 Filename:  some color procedure.zip
 Filesize:  33.28 KB
 Downloaded:  431 Time(s)

Display posts from previous:   
   Index -> Programming, Turing -> Turing Submissions
View previous topic Tell A FriendPrintable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 3 Posts ]
Jump to:   


Style:  
Search: