um helppppppppp
Author |
Message |
cinnamonhugs
|
Posted: 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 |
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
Tony
![](http://wiki.compsci.ca/images/f/f4/OniTony.gif)
|
Posted: Fri Mar 31, 2006 8:53 pm Post subject: (No subject) |
|
|
you can't add arrays and integers together. Different types. |
Tony's programming blog. DWITE - a programming contest. |
|
|
|
![](images/spacer.gif) |
person
|
Posted: Fri Mar 31, 2006 8:53 pm Post subject: (No subject) |
|
|
1)
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 |
|
|
|
|
![](images/spacer.gif) |
Clayton
![](http://compsci.ca/v3/uploads/user_avatars/1718239683472e5c8d7e617.jpg)
|
Posted: 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 |
|
|
|
|
![](images/spacer.gif) |
|
|