• LQDOJ
  • Trang chủ
  • Bài tập
  • Bài nộp
  • Thành viên
  • Kỳ thi
  • Nhóm
  • Giới thiệu
    • Máy chấm
    • Khóa học
    • Đề xuất ý tưởng
    • Đề xuất bài tập
    • Tools
    • Báo cáo tiêu cực
    • Báo cáo lỗi

Tiếng Việt

Tiếng Việt
English

Đăng nhập

Đăng ký

thanhdatdn2015

  • Giới thiệu
  • Bài tập
  • Bài nộp

Rating
-
Bài tập
91
Điểm
10217
Rating #
-
Điểm #
6062

Nguyễn Quang Thành Đạt (TH Lê Văn Tám, quận Thanh Khê, Thành Phố Đà Nẵng)

Giới thiệu

Nguyễn Quang Thành Đạt (TH Lê Văn Tám, quận Thanh Khê, Thành Phố Đà Nẵng)
-Ai đồ của tôi:
Small
tknhatbm
code đồng hồ dành cho các bạn hay AFK
lưu ý: code bằng python, không được chạy ở python online
from turtle import *
from datetime import datetime

def jump(distanz, winkel=0):
penup()
right(winkel)
forward(distanz)
left(winkel)
pendown()

def hand(laenge, spitze):
fd(laenge*1.15)
rt(90)
fd(spitze/2.0)
lt(120)
fd(spitze)
lt(120)
fd(spitze)
lt(120)
fd(spitze/2.0)

def make_hand_shape(name, laenge, spitze):
reset()
jump(-laenge*0.15)
begin_poly()
hand(laenge, spitze)
end_poly()
hand_form = get_poly()
register_shape(name, hand_form)

def clockface(radius):
reset()
pensize(7)
for i in range(60):
jump(radius)
if i % 5 == 0:
fd(25)
jump(-radius-25)
else:
dot(3)
jump(-radius)
rt(6)

def setup():
global second_hand, minute_hand, hour_hand, writer
mode("logo")
make_hand_shape("second_hand", 125, 25)
make_hand_shape("minute_hand", 130, 25)
make_hand_shape("hour_hand", 90, 25)
clockface(160)
second_hand = Turtle()
second_hand.shape("second_hand")
second_hand.color("gray20", "gray80")
minute_hand = Turtle()
minute_hand.shape("minute_hand")
minute_hand.color("blue1", "red1")
hour_hand = Turtle()
hour_hand.shape("hour_hand")
hour_hand.color("blue3", "red3")
for hand in second_hand, minute_hand, hour_hand:
hand.resizemode("user")
hand.shapesize(1, 1, 3)
hand.speed(0)
ht()
writer = Turtle()
#writer.mode("logo")
writer.ht()
writer.pu()
writer.bk(85)

def wochentag(t):
wochentag = ["Monday", "Tuesday", "Wednesday",
"Thursday", "Friday", "Saturday", "Sunday"]
return wochentag[t.weekday()]

def datum(z):
monat = ["Jan.", "Feb.", "Mar.", "Apr.", "May", "June",
"July", "Aug.", "Sep.", "Oct.", "Nov.", "Dec."]
j = z.year
m = monat[z.month - 1]
t = z.day
return "%s %d %d" % (m, t, j)

def tick():
t = datetime.today()
sekunde = t.second + t.microsecond0.000001
minute = t.minute + sekunde/60.0
stunde = t.hour + minute/60.0
try:
tracer(False) # Terminator can occur here
writer.clear()
writer.home()
writer.forward(65)
writer.write(wochentag(t),
align="center", font=("Courier", 14, "bold"))
writer.back(150)
writer.write(datum(t),
align="center", font=("Courier", 14, "bold"))
writer.forward(85)
second_hand.setheading(6
sekunde) # or here
minute_hand.setheading(6minute)
hour_hand.setheading(30
stunde)
tracer(True)
ontimer(tick, 100)
except Terminator:
pass # turtledemo user pressed STOP

def main():
tracer(False)
setup()
tracer(True)
tick()
return "EVENTLOOP"

if name == "main":
mode("logo")
msg = main()
print(msg)
mainloop()
Code đồng hồ xuất bản
Ấn vào đây!!!
https://readme-typing-svg.demolab.com/?font=Algerian&weight=900&size=23&duration=2593&pause=1&color=FFC470&background=FFF9F600&random=false&width=500&lines=%C4%90i%20h%E1%BB%8Dc%20nh%C6%B0%20%C4%91i%20%20tu;ng%E1%BB%93i%20h%E1%BB%8Dc%20nh%C6%B0%20ng%E1%BB%93i%20t%C3%B9;s%C3%A1ch%20v%E1%BB%9F%20l%C3%A0%20k%E1%BA%BB%20th%C3%B9;th%E1%BA%A7y%20c%C3%B4%20l%C3%A0%20%C4%91%E1%BB%8Bch%20th%E1%BB%A7;th%E1%BA%B1ng%20ng%E1%BB%93i%20c%E1%BA%A1nh%20m%E1%BA%B7t%20%C4%91%C3%B9;h%E1%BB%8Dc%20c%C3%A0ng%20ng%C3%A0y%20c%C3%A0ng%20ngu
my friend:
-kylekien-
-lion1914-
-lecongminhhuan-
-daoquynhanh-
-minhnhat2306-


«    »
Thứ 2
Thứ 3
Thứ 4
Thứ 5
Thứ 6
Thứ 7
CN
Ít
Nhiều

proudly powered by DMOJ| developed by LQDJudge team