
-----------------------------------
cinnamonhugs
Fri Mar 31, 2006 8:39 pm

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

-----------------------------------
Tony
Fri Mar 31, 2006 8:53 pm


-----------------------------------
you can't add arrays and integers together. Different types.

-----------------------------------
person
Fri Mar 31, 2006 8:53 pm


-----------------------------------
1)
 
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
Sat Apr 01, 2006 8:06 pm


-----------------------------------
In your case you had it mostly right but you missed one thing

%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
