#Added by @Fatma Farjallah # Optimize the code by @Azharo
#Python 3

import turtle
from turtle import *
import random

#ciel 
x = turtle.Turtle()
window = turtle.Screen()
window.bgcolor ("black")
x.hideturtle()
title("Fatma Farjallah.")
x.speed(0)

#moon
x.up()
x.goto(30,-120)
x.down()
x.color("#ffff00")
x.width(20)
x.begin_fill()
x.circle(150)
x.end_fill()
x.goto(-35,-100)
x.color("black")
x.begin_fill()
x.circle(136)
x.end_fill()

#left eye
x.up()
x.goto(110,25)
x.down()
x.color("black","white")
x.width(3)
x.begin_fill()
x.circle(25)
x.end_fill()
x.up()
x.goto(118,40)
x.down()
x.color("black")
x.width(3)
x.begin_fill()
x.circle(11)
x.end_fill()
x.up()
x.goto(111,45)
x.down()
x.color("white")
x.width(3)
x.begin_fill()
x.circle(5)
x.end_fill()

#right eye
x.up()
x.goto(180,25)
x.down()
x.color("black","white")
x.width(3)
x.begin_fill()
x.circle(30)
x.end_fill()
x.up()
x.goto(185,40)
x.down()
x.color("black")
x.width(3)
x.begin_fill()
x.circle(15)
x.end_fill()
x.up()
x.goto(175,48)
x.down()
x.color("white")
x.width(3)
x.begin_fill()
x.circle(6)
x.end_fill()

#mouth
x.up()
x.goto(140,-20)
x.down()
x.color("red")
x.width(3)
x.begin_fill()
x.circle(19)
x.end_fill()
x.up()
x.goto(140,-10)
x.down()
x.color("#ffff00")
x.width(3)
x.begin_fill()
x.circle(20)
x.end_fill()

########################### Optimize the code by @Azharo ####################
#stars

def random_stars():
        for i in [(280,230),(200,200),(120,260),(30,230),(-50,260),(-110,270),(-190,230),(-270,270),(-310,220),(280,150),(200,100),(30,100),(-50,150),(-110,160),(-190,120),(-250,180),(-310,150),(280,50),(30,100),(-50,50),(-110,100),(-190,40),(-270,50),(-310,100),(280,0),(200,-50),(30,5),(-50,0),(-110,10),(-190,-70),(-270,0),(-310,-50),(280,-100),(200,-150),(30,-150),(-110,-150),(-190,-140),(-270,-100),(-310,-150),(280,-150),(200,-200),(120,-150),(30,-50),(-50,-150),(-110,-50),(-190,-140),(-270,-200),(-310,-150),(280,-250),(200,-270),(120,-250),(30,-300),(-50,-250),(-110,-300),(-190,-250),(-270,-300),(-310,-250),(30,-270),(120,-250),(-150,-200)]:
            x.up()
            x.goto(i)
            x.color(random.choice(["#4d4dff", "#ff99ff", "#ffb3d9", "#99ff99", "#ffffff","#ff0000","#bf80ff","#ffb3ff","yellow"]))
            x.width(5)
            x.down()        
            x.begin_fill()
            for i in range (5):
                x.forward(15)
                x.right(144)
            x.end_fill()
random_stars()

###########################################

#good luck
x.up()
x.goto(0,-200)
x.down()
x.color("white")
x.width(5)
x.forward(80)
x.up()
x.goto(18,-220)
x.down()
x.color("white")
x.width(5)
x.forward(25)
x.left(90)
x.forward(35)
x.left(45)
x.forward(4)
x.up()
x.goto(40,-220)
x.down()
x.color("white")
x.width(5)
x.right(135)
x.forward(27)
x.up()
x.goto(30,-230)
x.down()
x.color("white")
x.width(5)
x.forward(25)
x.right(90)
x.forward(20)
x.right(90)
x.forward(20)
x.left(90)
x.forward(1)
x.left(90)
x.forward(20)
x.right(90)
x.forward(5)
x.up()
x.goto(30,-230)
x.down()
x.color("white")
x.width(5)
x.left(1)
x.forward(27)

window.exitonclick()
