r/programmingbydoing • • 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

3 comments sorted by

View all comments

Show parent comment

1

u/Arbitrationer May 25 '17

I literally just noticed that Boring Triangle was still down at the bottom there. I force myself to retype everything for the repetition and that was from the previous exercise XP. I must have just typed it without noticing.

Also, is that library the java.awt.*? I missed that when I copy/pasted.

1

u/Fic May 25 '17

Yes, you need java.awt.canvas, java.awt.polygon, java.awt.color, and java.awt.graphics. You can just replace all of those with java.awt.* if you like.