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

Username:   Password: 
 RegisterRegister   
 image function?
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
TrAnCeIn4LiFe




PostPosted: Fri Jun 18, 2004 8:46 pm   Post subject: image function?

how could u make an image to be a function?
Sponsor
Sponsor
Sponsor
sponsor
SuperGenius




PostPosted: Fri Jun 18, 2004 9:25 pm   Post subject: (No subject)

what goal are you trying to accompish?
TrAnCeIn4LiFe




PostPosted: Fri Jun 18, 2004 9:29 pm   Post subject: (No subject)

ah make an image be returned inside a function like attack ability but in function statment not process.
Tony




PostPosted: Fri Jun 18, 2004 9:45 pm   Post subject: (No subject)

then you return the integer pointer to the picture.

code:

var pic1 : int := Pic.FileNew ("whatever")
var pic2 : int := Pic.FileNew ("whateverelse")

function whatPicture () : int

    if Rand.Int (0, 1) = 1 then
        result pic1
    else
        result pic2
    end if

end whatPicture

Pic.Draw (whatPicture (), x, y, picCopy)
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 4 Posts ]
Jump to:   


Style:  
Search: