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

Username:   Password: 
 RegisterRegister   
 um helppppppppp
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
cinnamonhugs




PostPosted: Fri Mar 31, 2006 8:39 pm   Post subject: um helppppppppp

im trying to make a triangle move using drawfillpolygon but it keeps saying there are errors, whats the error?

for a : 420 .. 700 by 5
var x : array 1 .. 3 of int := init (350, 350, 440)
var y : array 1 .. 3 of int := init (130, 180, 130)
drawfillpolygon (x + a, y, 3, 102)
drawpolygon (x + a, y, 3, 103)
delay (50)
drawfillpolygon (x + a, y, 3, 77)
drawpolygon (x + a, y, 3, 77)
end for
Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Fri Mar 31, 2006 8:53 pm   Post subject: (No subject)

you can't add arrays and integers together. Different types.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
person




PostPosted: Fri Mar 31, 2006 8:53 pm   Post subject: (No subject)

1)
code:

use code tags

2) http://www.compsci.ca/v2/viewtopic.php?t=461
3) an array of integers is not the same as an integer, only an index of an array of integers can be added to an integer
Clayton




PostPosted: Sat Apr 01, 2006 8:06 pm   Post subject: (No subject)

In your case you had it mostly right but you missed one thing
code:

%you had
drawfillpolygon (x+a...)
%what you need
drawfillpolygon (x(1)+a....)

so what you need to do is add a single element of your array to an integer, not the entire array
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: