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

Username:   Password: 
 RegisterRegister   
 wheel of fortune program, what does this mean? - Illegal picture ID number '0'
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
kronos44




PostPosted: Tue Jun 12, 2007 4:23 pm   Post subject: wheel of fortune program, what does this mean? - Illegal picture ID number '0'

when i run my program it gives me this retarded error message that says "Illegal picture ID number '0'"
it happens on this line: wheelDegree := Pic.Rotate (wheel, i, centreX, centreY)

here's the section of the program with the error:

%pic of wheel
var wheel : int := Pic.New (0, 0, 500, 500)

%draw pointer
var xp : array 1 .. 3 of int := init (70, 30, 30)
var yp : array 1 .. 3 of int := init (250, 260, 240)
drawfillpolygon (xp, yp, 3, blue)

%draw scores
drawfillbox (5, 5, 100, 100, 1)
drawfillbox (400, 5, 495, 100, 1)
Font.Draw (p1, 15, 80, nameFont, white)
Font.Draw (p2, 410, 80, nameFont, white)


%wheel spinning time
var degreeOfSpin : int
var wheelDegree : int
var loseTurn1, loseTurn2 : int
loseTurn1 := 0
loseTurn2 := 0
var lostTurns1, lostTurns2 : int
lostTurns1 := 0
lostTurns2 := 0
var p1cash, p2cash : int
p1cash := 0
p2cash := 0
var p1fontCash, p2fontCash : string
p1fontCash := ""
p2fontCash := ""

loop

if loseTurn1 not= 1 or lostTurns1 > 1 then
loseTurn1 := 0
lostTurns1 := 0
put p1, " press enter to spin"
loop
getch (go)
if go = chr (10) then
randint (degreeOfSpin, 540, 1440)

for i : 0 .. degreeOfSpin by 20
%rotate wheel, rotated wheel pic becomes wheeldegree
wheelDegree := Pic.Rotate (wheel, i, centreX, centreY)
cls

%draw scores
%drawfillbox (5, 5, 100, 100, 1)
%Font.Draw (p1, 15, 80, nameFont, white)
%drawfillbox (400, 5, 495, 100, 1)
%Font.Draw (p2, 410, 80, nameFont, white)

%draw new rotated wheel
Pic.Draw (wheelDegree, 0, 0, picCopy)
%draw pointer
drawfillpolygon (xp, yp, 3, blue)
delay (10)
end for
exit
end if

end loop
Sponsor
Sponsor
Sponsor
sponsor
Clayton




PostPosted: Tue Jun 12, 2007 4:26 pm   Post subject: RE:wheel of fortune program, what does this mean? - Illegal picture ID number \'0\'

You don't need to create another topic to ask a question you already asked in another thread. For that reason, I'm locking this one.
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  [ 2 Posts ]
Jump to:   


Style:  
Search: