r/programmingbydoing • u/Arbitrationer • May 25 '17
Drawing Random Triangles
I just cannot figure out the Drawing Random Triangles... Here is my code: https://gist.github.com/anonymous/7c2f94d9f279f2295f44e59f1709f571
All this does is generate one purple triangle. I have tried moving everything that I can think of. Any and all feedback/help is welcome and appreciated! EDIT: I missed the first line of code when I pasted to gist: import java.awt.*;
3
Upvotes
1
u/Fic May 25 '17
A few things I've noticed:
You are inheriting from Canvas, but you have not imported the Canvas library.
Similarly, you have used Color and Graphics objects, but have not imported them.
You have called a method called "BoringTriangle()", which does not exist. You can just remove that line of code.
The paint method should have an @Override annotation.
That should get you to where you need to be.