This site requires JavaScript, please enable it in your browser!
Greenfoot back
DaRafster
DaRafster wrote ...

2020/2/7

What is wrong with my code?

DaRafster DaRafster

2020/2/7

#
int[] xValues = (250,250,280,280,300,300,320,320);
        int[] yValues = (275,245,245,225,225,245,245,275);
        int points = 8;
        
        myImage.drawPolygon(xValues, yValues, points);
I'm drawing a polygon and the error says I need an identifier and another open bracket which makes no sense
DaRafster DaRafster

2020/2/7

#
The error comes in between xValues 250,250 and yValues 275,245
danpost danpost

2020/2/7

#
DaRafster wrote...
The error comes in between xValues 250,250 and yValues 275,245
Use curly brackets, not round ones, about your sets of values.
DaRafster DaRafster

2020/2/7

#
Thank you, still, a beginner in coding will definitely double-check the brackets from now on!
You need to login to post a reply.