I was doing a school project about pixelart and wanted to create a landscape. What is wrong?
""" Landscape Drawer.py
Draws landscape on a turtle screen"""
import turtle as t
import random as r
pen = t.Pen()
pen.hideturtle()
pen.speed('fastest')
pixelno = 90000
def controls():
if pen.xcor() == 150 or pen.xcor() == 150 or pen.ycor() == 150 or pen.ycor() == 150:
pen.right(90)
pen.forward(1)
pen.right(90)
def allcode():
while True:
t.colormode(255)
controls()
if pen.ycor() < -75:
rX = r.randint(0, 150)
gX = r.randint(0, 255)
bX = r.randint(0, 150)
pen.pencolor(rX, gX, bX)
pen.pendown()
pen.penup()
pen.forward(1)
elif pen.ycor() > -150 or pen.ycor < 150:
cloud = r.randint(1, 7)
if cloud == 7:
pen.pencolor(255, 255, 255)
t.pendown()
rY = r.randint(0, 150)
gY = r.randint(0, 150)
bY = r.randint(0, 255)
pen.pencolor(rY, gY, bY)
pen.pendown()
pen.penup()
pen.forward(1)
else:
print('Your landscape, look nice? ')
pen.penup()
pen.goto(-300, -300)
allcode()
pen.exitonclick()
P.S. I am using Python 3.8.2.
There are no errors, but the turtle screen is completely blank.
I have actually tried deleting the pen.hideturtle() and pen.speed('fastest') but it still won't work.
Thanks for your help!