# data[].attributes.body
I am sending my warmest hello from far. I am far but yes, my thoughts and prayers are always be with you. Please kindly collect this attachment and start to work it out with your teammates. Till I see you in the next class, have fun coding!

# data[].attributes.body
Hi all! You can upload your individual assignments on this padlet. Thanks.

# data[].attributes.attachment_link.readable_text
from turtle import *
from random import randint
mode('logo')
print ('Please maximize the window')


#Haresh Kumararajah(HK)
bgcolor('red')
speed(3)
pensize(10)
pencolor('green')
penup()
goto(-(199.70/2),-(199.70/2))
pendown()
fd(200)
bk(100)
seth(90)
fd(100)
a=(ycor()+100)
sety(a)
a-=200
sety(a)
seth(0)
fd(100)
seth(45)
fd(141)
bk(141)
seth(135)
fd(141)
penup()
home()
bgcolor('white')
clear()

#Road
dis=3
pendown()
pensize(2)
color('black')
penup()
goto(-500,-20)
pendown()
fillcolor('grey')
begin_fill()
setx(500)
sety(-100)
setx(-500)
goto(-500,-20)
end_fill()
penup()
goto(-500,-60)
rt(90)
pencolor('white')
for i in range(5):
    fd(100)
    pendown()
    fd(100)
    penup()
pencolor('black')
pendown()

#Sand
setheading(0)
fd(40)
print (position())
fillcolor('#DBD053')
begin_fill()
goto(500, 100)
print (position())
setheading(270)
fd(1000)
print (position())
setheading(180)
fd(120)
print (position())
end_fill()
speed(0)
penup()
# Credit to https://stackoverflow.com/questions/35612938/how-do-i-generate-random-dots-inside-my-turtle-circle-and-rectangle
# draw random dots inside of rectangle
# @param origin: is a touple, containing `x` and `y` coordinates
# @param number_of_dots: int, number of dots
# @param size:   is a touple, containing `width` and `height` of rectangle
def draw_random_dots_in_rectangle(origin, number_of_dots, size):
    # loops number_of_dots times
    for _ in range(number_of_dots):
        # generate a random position inside of given rectangle
        # using min/max, because of possible negative coordinates
        # weakness - does also place dots on the edges of the rectangle
        rand_x = randint(min(origin[0], origin[0] + size[0]), max(origin[0], origin[0] + size[0]))
        rand_y = randint(min(origin[1], origin[1] + size[1]), max(origin[1], origin[1] + size[1]))
        # moves to the random position
        goto((rand_x, rand_y))
        # creates a dot
        dot(3)
draw_random_dots_in_rectangle([-500,-20], 30, [1000,120])
goto(-500,-20)
pendown()
speed(3)
bk(120)

#Water
fillcolor('#006994')
begin_fill()
setheading(0)
fd(100)
setheading(90)
fd(1000)
rt(90)
fd(100)
end_fill()
bk(100)

#Sky
seth(0)
fillcolor('#FD2F24')
begin_fill()
fd(100)
seth(270)
fd(1000)
seth(180)
fd(100)
end_fill()
seth(90)
penup()
fd(430)
seth(0)
pendown()

#Sun
fillcolor('#FED800')
begin_fill()
circle(-70,180)
end_fill()

#Grass
penup()
goto(-500,-100)
pendown()
fillcolor('green')
begin_fill()
seth(180)
fd(150)
seth(90)
fd(1000)
seth(0)
fd(150)
end_fill()

# data[].attributes.headline
Nur Farah Adila binti Shaiful Haili (turtle

# data[].attributes.subject
Nur Farah Adila binti Shaiful Haili (turtle

# data[].attributes.attachment_link.readable_text

import turtle

svt = turtle.Pen()
window=svt.screen
window.bgcolor('black')
svt.shape('turtle')

svt.ht()
svt.pensize(3)
svt.speed(8)
svt.left(90)
svt.pu()
svt.forward(250)
svt.left(150)

svt.pd()

for turtle in range(2):
    svt.forward(250)
    svt.left(120)
svt.forward(250)
svt.right(120)

svt.color('white','lightpink')
svt.begin_fill()
svt.forward(250)
svt.right(120)
svt.forward(190)
for turtle in range(2):
    svt.right(60)
    svt.forward(30)
svt.right(60)
svt.forward(100)
svt.left(120)
svt.forward(130)
svt.right(60)
svt.forward(30)
svt.left(60)
svt.forward(30)
svt.right(120)
svt.forward(30)
svt.end_fill()

svt.right(120)
svt.forward(30)
svt.left(60)
svt.forward(190)
svt.right(150)
svt.forward(50)
svt.backward(50)
svt.left(30)
svt.forward(130)
svt.right(60)
svt.forward(30)
svt.backward(30)
svt.left(120)
svt.forward(30)
svt.backward(30)
svt.right(60)
svt.backward(130)
svt.left(120)
svt.backward(220)
svt.left(60)
svt.backward(220)
svt.left(60)

svt.color('white','lightsteelblue')
svt.begin_fill()
svt.forward(250)
svt.right(120)
svt.forward(190)
for turtle in range(2):
    svt.right(60)
    svt.forward(30)
svt.right(60)
svt.forward(100)
svt.left(120)
svt.forward(130)
svt.right(60)
svt.forward(30)
svt.left(60)
svt.forward(30)
svt.right(120)
svt.forward(30)
svt.end_fill()

svt.right(120)
svt.forward(30)
svt.left(60)
svt.forward(190)
svt.right(150)
svt.forward(50)
svt.backward(50)
svt.left(30)
svt.forward(130)
svt.right(60)
svt.forward(30)
svt.backward(30)
svt.left(120)
svt.forward(30)
svt.backward(30)
svt.right(60)
svt.backward(130)
svt.left(120)
svt.backward(220)
svt.left(60)
svt.backward(220)
svt.left(60)

svt.color('white','lightgray')
svt.begin_fill()
svt.forward(250)
svt.right(120)
svt.forward(190)
for turtle in range(2):
    svt.right(60)
    svt.forward(30)
svt.right(60)
svt.forward(100)
svt.left(120)
svt.forward(130)
svt.right(60)
svt.forward(30)
svt.left(60)
svt.forward(30)
svt.right(120)
svt.forward(30)
svt.end_fill()

svt.right(120)
svt.forward(30)
svt.left(60)
svt.forward(190)
svt.right(150)
svt.forward(50)
svt.backward(50)
svt.left(30)
svt.forward(130)
svt.right(60)
svt.forward(30)
svt.backward(30)
svt.left(120)
svt.forward(30)
svt.backward(30)
svt.right(60)
svt.backward(130)
svt.left(120)
svt.backward(190)



svt.color('white','lightsteelblue')
svt.begin_fill()
svt.right(60)
svt.forward(160)
svt.right(120)
svt.forward(60)
svt.right(60)
svt.forward(130)
svt.right(60)
svt.forward(30)
svt.end_fill()

svt.right(60)
svt.forward(30)
svt.right(120)
svt.forward(30)
svt.left(60)
svt.forward(130)
svt.backward(130)
svt.right(120)
svt.forward(30)

svt.color('white','lightgray')
svt.begin_fill()
svt.left(60)
svt.forward(160)
svt.left(60)
svt.forward(30)
svt.left(60)
svt.forward(30)
svt.left(60)
svt.forward(130)
svt.left(60)
svt.forward(60)
svt.end_fill()

svt.backward(30)
svt.left(120)
svt.forward(130)
svt.right(60)
svt.forward(30)
svt.backward(30)
svt.left(120)
svt.forward(30)

svt.color('white','lightpink')
svt.begin_fill()
svt.left(60)
svt.forward(160)
svt.left(60)
svt.forward(30)
svt.left(60)
svt.forward(30)
svt.left(60)
svt.forward(130)
svt.left(60)
svt.forward(60)
svt.end_fill()

svt.backward(30)
svt.left(120)
svt.forward(130)
svt.right(60)
svt.forward(30)
svt.backward(30)
svt.left(120)
svt.forward(30)

svt.left(60)
svt.forward(65)
svt.pu()
svt.goto(0,-270)

svt.write('SEVENTEEN',font=('Arial',45,'bold'),align='center')

# data[].attributes.headline
Hamzah bin Sahirul Amri (Individual Project)

# data[].attributes.subject
Hamzah bin Sahirul Amri (Individual Project)

# data[].attributes.attachment_link.readable_text
import turtle
import time
import random

#interface
turtle.bgcolor("black")
t = turtle.Pen()
t.speed(1000)
t.color("white")
t.ht()
t.pu()
t.right(90)
t.forward(110)
t.left(90)
t.pd()
t.circle(110)
t.pu()
t.right(90)
t.forward(75)
t.right(90)
t.pd()
t.forward(500)
t.right(180)
t.forward(1000)
t.right(270)
print("Completed:10%...")
for x in range(1,21):
    a = random.randint(25,74)
    t.color("white")
    t.forward(a)
    t.left(90)
    t.forward(50)
    t.left(90)
    t.forward(a)
    for x in range(1,5):
        t.forward(a)
        t.left(90)
        t.forward(50)
        t.left(90)
    t.right(180)
print("Completed:70%...")
#left border
t.pu()
t.forward(1000)
t.left(180)
t.pd()
t.forward(2000)
t.pu()
t.right(180)
t.forward(2000)
t.right(180)
for x in range(1,4):
    t.forward(1000)
    t.left(90)
print("Completed:90%...")
#right border
t.right(270)
t.pd()
t.forward(2000)
print("Completed!")
print("\n")
#duration
c = input("Unit?(Seconds[S]/Minutes[M]):")
#seconds
if c=="S" or c=="s":
    b = int(input("Give time:"))
    input("Press Enter to start")
    secs = turtle.Pen()
    secs.speed(100)
    secs.color("white")
    secs.left(90)
    secs.ht()
    for x in range(1,b):
        secs.forward(100)
        time.sleep(1)
        secs.undo()
        secs.right(6)
#minutes
elif c=="M" or c=="m":
    b = int(input("Give time:"))
    input("Press Enter to start")
    mint = turtle.Pen()
    mint.speed(100)
    mint.color("white")
    mint.left(90)
    mint.ht()
    for x in range(1,b):
        mint.forward(90)
        time.sleep(60)
        mint.undo()
        mint.right(6)

#end
while True:
    time.sleep(1)
    turtle.bgcolor("white")
    time.sleep(1)
    turtle.bgcolor("black")

# data[].attributes.headline
Muhammad Ubaidah Al-Jarrah (Individual Project)

# data[].attributes.subject
Muhammad Ubaidah Al-Jarrah (Individual Project)

# data[].attributes.body
Nasib baik hamzah buat analog punya version

# data[].attributes.attachment_link.readable_text
import turtle
import time

pew=turtle.Pen()
pew.ht()
pew.speed(5)
pew.color("grey")
pew.pensize(22)
turtle.bgcolor("black")

##Logo(MUJ)
pew.penup()
pew.goto(40, 100)
pew.right(90)
pew.pendown()
#U
for x in range(1,10):
    pew.forward(10)
    pew.right(10)
pew.right(90)
pew.forward(65)
pew.left(90)
#M
for x in range(1,5):
    pew.forward(10)
    pew.left(20)
pew.right(140)
for x in range(1,5):
    pew.forward(10)
    pew.left(20)
pew.left(70)
pew.forward(115)
pew.left(90)
pew.forward(40)
#J
for x in range(1,31):
    pew.forward(6)
    pew.left(3)
pew.forward(45)
pew.left(90)
pew.forward(160)

##Logo Shade
pew.pensize(12)
pew.left(90)
pew.forward(10)
pew.color("white")
pew.left(90)
pew.forward(150)
pew.right(90)
pew.forward(40)
#J
for x in range(1,23):
    pew.forward(6.5)
    pew.right(4)
pew.forward(50)
pew.right(92)
pew.penup()
pew.forward(90)
pew.right(90)
pew.forward(5)
pew.pendown()
#M
for x in range(1,20):
    pew.forward(1)
    pew.right(3)
pew.left(55)
pew.penup()
pew.forward(25)
pew.left(92)
pew.forward(12)
pew.pendown()
pew.backward(55)
pew.right(90)
pew.penup()
pew.forward(22)
pew.left(90)
pew.forward(18)
pew.right(90)
pew.pendown()
#U
for x in range(1,10):
    pew.left(10)
    pew.forward(6)
pew.forward(10)

##Timer
turtle.bgcolor("white")
pew.color("black")
pew.clear()
#Start
pew.write("Set the timer\n<==========",font=('Arial',30,'bold'),align='center')
time.sleep(1)
pew.clear()
#Time set
while True:
    print("\n\nDigital Timer\nby Ubaidah\n")
    h=int(input("Set the hour :"))
    
    m=int(input("Set the minute :"))
    if m>60:
        print("Invalid Input!")
        break
    s=int(input("Set the second :"))
    if s>60:
        print("Invalid Input!")
        break
#Convert input hour and minute to seconds
    seconds=(h*3600 +m*60 +(s+1))
    print("You set the timer to " +str(seconds-1) +" seconds\n")
    start=input("Enter 'ok' to start the timer :")
    if start!="ok":
        print("Invalid Input...\nBut i'll start the countdown anyway :p")
#Countdown
    while seconds>0:
        seconds=seconds-1    
        pew.write(seconds,font=('Times',70,'bold'),align='center')
        time.sleep(1)
        pew.clear()
    if seconds==0:
        pew.write("Times Up!!!",font=('Comic Sans MS',70,'bold'),align='center')
#End
    restart=input("Times up!!!\nDo you need a new timer? (y/n) :")
    if restart=="n":
        print("Goodbye")
        break
    elif restart!="y":
        print("Invalid Input...\nBut i'll give you a new timer anyway :p")



# data[].attributes.attachment_link.readable_text
# This program draws the stars of the Orion constellation
# the names of the stars, and the constellation lines.

import turtle

# Set the window size.
turtle.setup(700, 1000)

# Set the window size.
turtle.penup()
turtle.hideturtle()

#Orion
# Create name constants for the star coordinates.
LEFT_SHOULDER_X = -70
LEFT_SHOULDER_Y = 200

RIGHT_SHOULDER_X = 80
RIGHT_SHOULDER_Y = 180

LEFT_BELTSTAR_X = -40
LEFT_BELTSTAR_Y = -20

MIDDLE_BELTSTAR_X = 0
MIDDLE_BELTSTAR_Y = 0

RIGHT_BELTSTAR_X = 40
RIGHT_BELTSTAR_Y = 20

LEFT_KNEE_X = -90
LEFT_KNEE_Y = -180

RIGHT_KNEE_X = 120
RIGHT_KNEE_Y = -140

# Draw the stars.
turtle.goto(LEFT_SHOULDER_X, LEFT_SHOULDER_Y)
turtle.dot()
turtle.goto(RIGHT_SHOULDER_X, RIGHT_SHOULDER_Y)
turtle.dot()
turtle.goto(LEFT_BELTSTAR_X, LEFT_BELTSTAR_Y)
turtle.dot()
turtle.goto(MIDDLE_BELTSTAR_X, MIDDLE_BELTSTAR_Y)
turtle.dot()
turtle.goto(RIGHT_BELTSTAR_X, RIGHT_BELTSTAR_Y)
turtle.dot()
turtle.goto(LEFT_KNEE_X, LEFT_KNEE_Y)
turtle.dot()
turtle.goto(RIGHT_KNEE_X, RIGHT_KNEE_Y)
turtle.dot()

# Display the star names
turtle.goto(LEFT_SHOULDER_X, LEFT_SHOULDER_Y)
turtle.write('Betegeus', font=('High Tower Text', 10))
turtle.goto(RIGHT_SHOULDER_X, RIGHT_SHOULDER_Y)
turtle.write('Meissa', font=('High Tower Text', 10))
turtle.goto(LEFT_BELTSTAR_X, LEFT_BELTSTAR_Y)
turtle.write('Alnitak', font=('High Tower Text', 10))
turtle.goto(MIDDLE_BELTSTAR_X, MIDDLE_BELTSTAR_Y)
turtle.write('Alnilam', font=('High Tower Text', 10))
turtle.goto(RIGHT_BELTSTAR_X, RIGHT_BELTSTAR_Y)
turtle.write('Mintaka', font=('High Tower Text', 10))
turtle.goto(LEFT_KNEE_X, LEFT_KNEE_Y)
turtle.write('Saiph', font=('High Tower Text', 10))
turtle.goto(RIGHT_KNEE_X, RIGHT_KNEE_Y)
turtle.write('Rigel', font=('High Tower Text', 10))

# Draw a line from the left shoulder to left belt star
turtle.goto(LEFT_SHOULDER_X, LEFT_SHOULDER_Y)
turtle.pendown()
turtle.goto(LEFT_BELTSTAR_X, LEFT_BELTSTAR_Y)
turtle.penup()

# Draw a line from the right shoulder to right belt star
turtle.goto(RIGHT_SHOULDER_X, RIGHT_SHOULDER_Y)
turtle.pendown()
turtle.goto(RIGHT_BELTSTAR_X, RIGHT_BELTSTAR_Y)
turtle.penup()

# Draw a line from the left belt star to middle belt star
turtle.goto(LEFT_BELTSTAR_X, LEFT_BELTSTAR_Y)
turtle.pendown()
turtle.goto(MIDDLE_BELTSTAR_X, MIDDLE_BELTSTAR_Y)
turtle.penup()

# Draw a line from the middle belt star to right belt star
turtle.goto(MIDDLE_BELTSTAR_X, MIDDLE_BELTSTAR_Y)
turtle.pendown()
turtle.goto(RIGHT_BELTSTAR_X, RIGHT_BELTSTAR_Y)
turtle.penup()

# Draw a line from the left belt star to left knee
turtle.goto(LEFT_BELTSTAR_X, LEFT_BELTSTAR_Y)
turtle.pendown()
turtle.goto(LEFT_KNEE_X, LEFT_KNEE_Y)
turtle.penup()

# Draw a line from the right belt star to right knee
turtle.goto(RIGHT_BELTSTAR_X, RIGHT_BELTSTAR_Y)
turtle.pendown()
turtle.goto(RIGHT_KNEE_X, RIGHT_KNEE_Y)
turtle.penup()

#name
turtle.penup()
turtle.goto(80, 140)
turtle.pendown()
turtle.write("Orion Constellation", font = ('Monotype Corsiva', 15))
turtle.penup()

#Libra

# Create name constants for the star coordinates.
omega_X = -300
omega_Y = 100

zubenkrab_X = -275
zubenkrab_Y = 200

zubenchama_X = -200
zubenchama_Y = 300

zubengenu_X = -120
zubengenu_Y = 250

brachium_X = -160
brachium_Y = 0

ulibra_X = -285
ulibra_Y = -80

tlibra_X = -290
tlibra_Y = -130

# Draw the stars.
turtle.goto(omega_X, omega_Y)
turtle.dot()
turtle.goto(zubenkrab_X, zubenkrab_Y)
turtle.dot()
turtle.goto(zubenchama_X, zubenchama_Y)
turtle.dot()
turtle.goto(zubengenu_X, zubengenu_Y)
turtle.dot()
turtle.goto(brachium_X, brachium_Y)
turtle.dot()
turtle.goto(ulibra_X, ulibra_Y)
turtle.dot()
turtle.goto(tlibra_X, tlibra_Y)
turtle.dot()

# Display the star names
turtle.goto(omega_X, omega_Y)
turtle.write("Omega Librae", font=('High Tower Text', 10))
turtle.goto(zubenkrab_X, zubenkrab_Y)
turtle.write("Zubenelkrab y Librae", font=('High Tower Text', 10))
turtle.goto(zubenchama_X, zubenchama_Y)
turtle.write("Zubeneschamali Beta Librae", font=('High Tower Text', 10))
turtle.goto(zubengenu_X, zubengenu_Y)
turtle.write("Zubenelgenubi Alpha Librae", font=('High Tower Text', 10))
turtle.goto(brachium_X, brachium_Y)
turtle.write("Brachium Alpha Librae", font=('High Tower Text', 10))
turtle.goto(ulibra_X, ulibra_Y)
turtle.write("u Librae", font=('High Tower Text', 10))
turtle.goto(tlibra_X, tlibra_Y)
turtle.write("t Librae", font=('High Tower Text', 10))

#Draw the line
turtle.goto(omega_X, omega_Y)
turtle.pendown()
turtle.goto(zubenkrab_X, zubenkrab_Y)
turtle.goto(zubenchama_X, zubenchama_Y)
turtle.goto(zubengenu_X, zubengenu_Y)
turtle.goto(brachium_X, brachium_Y)
turtle.goto(ulibra_X, ulibra_Y)
turtle.goto(tlibra_X, tlibra_Y)
turtle.penup()
turtle.goto(brachium_X, brachium_Y)
turtle.pendown()
turtle.goto(zubenchama_X, zubenchama_Y)
turtle.penup()
turtle.goto(-290, -160)
turtle.pendown()
turtle.write("Libra Constellation", font = ('Monotype Corsiva', 15))
turtle.penup()


#text3
turtle.penup()
turtle.goto(160, -160)
turtle.pendown()
turtle.write("Two of constellations seen on 10th October 2003", font = ('Monotype Corsiva', 15))
turtle.goto(160, -180)
turtle.write("Source; www.skymaponline.net", font = ('Monotype Corsiva', 15))

# Keep the window open.
turtle.done()

# data[].attributes.attachment_link.readable_text
import turtle
runner = turtle.Turtle()
screen = turtle.Screen()
screen.bgcolor("black")
#Makes a function to set turtle motion
def up():
    runner.setheading(90)
    runner.fd(60)
    runner.pos()

def left():
    runner.setheading(180)
    runner.fd(60)
    runner.pos()

def right():
    runner.setheading(360)
    runner.fd(60)
    runner.pos()

def down():
    runner.setheading(-90)
    runner.fd(60)
    runner.pos()
#Maze template I found online
runner.pencolor("cyan")
runner.pensize(3)
runner.penup()
runner.goto(0,-180)
runner.pendown()
runner.speed(10)
runner.setheading(180)
runner.fd(180)
runner.setheading(90)
runner.fd(60)
runner.setheading(0)
runner.fd(120)
runner.backward(120)
runner.setheading(90)
runner.fd(300)
runner.setheading(0)
runner.fd(120)
runner.setheading(-90)
runner.fd(120)
runner.setheading(180)
runner.fd(60)
runner.setheading(90)
runner.fd(60)
runner.setheading(-90)
runner.fd(120)
runner.setheading(90)
runner.fd(60)
runner.setheading(0)
runner.fd(120)
runner.setheading(-90)
runner.fd(60)
runner.setheading(0)
runner.fd(60)
runner.setheading(-90)
runner.fd(60)
runner.backward(60)
runner.setheading(0)
runner.fd(60)
runner.setheading(90)
runner.fd(60)
runner.penup()
runner.setheading(180)
runner.fd(60)
runner.pendown()
runner.setheading(90)
runner.fd(60)
runner.setheading(180)
runner.fd(60)
runner.setheading(90)
runner.fd(60)
runner.setheading(0)
runner.fd(120)
runner.setheading(-90)
runner.fd(60)
runner.backward(60)
runner.setheading(0)
runner.fd(60)
runner.setheading(-90)
runner.fd(240)
runner.setheading(180)
runner.fd(60)
runner.setheading(-90)
runner.fd(60)
runner.setheading(180)
runner.fd(120)
runner.setheading(90)
runner.fd(60)
runner.setheading(180)
runner.fd(60)
runner.setheading(90)
runner.fd(60)
runner.backward(60)
runner.setheading(180)
runner.fd(60)
runner.penup()
runner.setheading(0)
runner.fd(300)
runner.pendown()
runner.setheading(-90)
runner.fd(120)
runner.setheading(180)
runner.fd(120)

runner.penup()
runner.goto(-30,150)
runner.setheading(-90)
runner.pendown()
runner.pencolor("green")
#Executes function to move to specific direction
screen.onkeypress(up, "Up")
screen.onkeypress(left, "Left")
screen.onkeypress(right, "Right")
screen.onkeypress(down, "Down")
#Binds screen with key press
screen.listen()

# data[].attributes.headline
Tengku Arshad Danish Darwish Bin Tengku Jusoh (Individual Project)

# data[].attributes.subject
Tengku Arshad Danish Darwish Bin Tengku Jusoh (Individual Project)

# data[].attributes.body
favorite_border
0
Your avatar

Add comment