Parallel&horizontal lines using loops

please i need help in my homework:

Exercise: draw random parallel and horizontal lines using loops.The length of each line is a random number between 0 and 44.


I would use a for loop to make different y positions for your lines.

The x positions will need to differ by a random amount.

You can draw lines with the line() function.

You can generate random numbers with the random() function.

It is hard to help you more without seeing your code.

Please post your current code for more help.

For more help, post your current code.

You should post your code. Then we can help you more.

Notice that I’ve said you should post your code three times.
That’s because it’s important. You should post it.


for (int y=0;y<=height;y=y+6){
for (int x=0;x<=width;x=x+12){

Parallel != vertical != horizontal