• TICA OJ
  • Trang chủ
  • Bài
  • Các bài nộp
  • Thành viên
  • tổ chức
  • Các kỳ thi
  • Thông tin
    >
    • Máy chấm
    • Custom Checkers
    • Github
VI EN Đăng nhập  hoặc  Đăng ký

Blog - Trang 1

  • Thông tin
  • Stats
  • Blog
  • Tuts

0

geometry dash code

py34_16 đã đăng vào 18, Tháng 6, 2026, 3:58
import tkinter as tk, math
class UltraImpossibleGame:
    def __init__(self, root):
        self.root = root
        self.root.title("The Impossible Game")
        self.w, self.h, self.sidebar_w, self.gravity, self.jump_force, self.base_speed, self.ground_y = 700, 400, 160, 1.5, -16, 8.5, 280
        self.vy, self.is_jumping, self.angle, self.active, self.loop_id, self.score, self.attempt = 0, False, 0, True, None, 0, 1
        self.speed = self.base_speed
        if not hasattr(self, 'top_scores'): self.top_scores = [0] * 10
        self.blocks, self.spikes = [], []
        self.track_layout = [(400, 's'), (650, 's'), (900, 'b'), (930, 'b'), (1150, 's'), (1350, 'b'), (1500, 's'), (2000, 's'), (2030, 's'), (2300, 'b'), (2330, 'b'), (2450, 's'), (2700, 'b'), (2730, 'u'), (3000, 's'), (3030, 's'), (3300, 'b'), (3330, 'b'), (3360, 'b'), (3550, 's'), (3800, 'b'), (3950, 's'), (3980, 's'), (4200, 'b'), (4230, 'b'), (4350, 's'), (4600, 'b'), (4630, 'b'), (4750, 'b'), (4780, 'b'), (4900, 's'), (4930, 's'), (4960, 's'), (5200, 'b'), (5230, 'u'), (5260, 'b'), (5500, 's'), (5700, 'b'), (5730, 'b'), (5760, 'u'), (6000, 's'), (6030, 's'), (6300, 'b'), (6330, 'b'), (6450, 's'), (6480, 's'), (6800, 'b'), (6830, 'b'), (6860, 'b'), (6890, 'u'), (7100, 's'), (7500, 's'), (7530, 's'), (7560, 's'), (7850, 'b'), (7880, 'u'), (7910, 'b'), (7940, 'u'), (8200, 's'), (8400, 'b'), (8430, 'b'), (8550, 's'), (8580, 's'), (8800, 'b'), (8830, 'u'), (9100, 's'), (9130, 's'), (9160, 's'), (9400, 'b'), (9430, 'b'), (9460, 'b'), (9600, 'u'), (9900, 's'), (10200, 'b'), (10230, 'u'), (10500, 's'), (10530, 's'), (11000, 'b'), (11030, 'b'), (11060, 'b'), (11090, 'b'), (11120, 'u')]
        self.canvas = tk.Canvas(root, width=self.w + self.sidebar_w, height=self.h, bg="#001122", highlightthickness=0)
        self.canvas.pack()
        self.setup()
        self.tick()
    def setup(self):
        self.score_txt = self.canvas.create_text(20, 30, text="PROGRESS: 0%", fill="#fff", font=("Arial", 12, "bold"), anchor="w")
        self.attempt_txt = self.canvas.create_text(self.w - 20, 30, text=f"ATTEMPT {self.attempt}", fill="#fff", font=("Arial", 12, "bold"), anchor="e")
        self.canvas.create_line(0, self.ground_y, self.w, self.ground_y, fill="#fff", width=3)
        self.canvas.create_rectangle(self.w, 0, self.w + self.sidebar_w, self.h, fill="#000b14", outline="#00ffff", width=2)
        self.canvas.create_text(self.w + 15, 30, text="TOP 10 RUNS", fill="#00ffff", font=("Arial", 11, "bold"), anchor="w")
        for i, val in enumerate(self.top_scores):
            color = "#ffaa00" if i==0 else "#00ffaa" if i<3 else "#8c9ea3"
            self.canvas.create_text(self.w + 15, 65 + (i * 28), text=f"{i+1}. {val}%", fill=color, font=("Courier New", 11, "bold"), anchor="w")
        self.p_size = 30
        self.px, self.py = 120, self.ground_y - self.p_size
        self.player_id = self.canvas.create_polygon(0, 0, 0, 0, 0, 0, 0, 0, fill="#ff4400", outline="#fff", width=2)
        for x, t in self.track_layout:
            if t == 's': self.spikes.append(self.canvas.create_polygon(x, self.ground_y, x+15, self.ground_y-30, x+30, self.ground_y, fill="#fff", outline="#001122"))
            elif t == 'b': self.blocks.append(self.canvas.create_rectangle(x, self.ground_y-30, x+30, self.ground_y, fill="#002244", outline="#00ffff", width=2))
            elif t == 'u':
                self.blocks.append(self.canvas.create_rectangle(x, self.ground_y-30, x+30, self.ground_y, fill="#002244", outline="#00ffff", width=2))
                self.spikes.append(self.canvas.create_polygon(x, self.ground_y-30, x+15, self.ground_y-60, x+30, self.ground_y-30, fill="#fff", outline="#001122"))
        self.root.bind("<space>", lambda e: self.jump())
        self.root.bind("<Up>", lambda e: self.jump())
    def jump(self):
        if not self.is_jumping and self.active: self.vy, self.is_jumping = self.jump_force, True
    def tick(self):
        if not self.active: return
        self.vy += self.gravity
        self.py += self.vy
        self.score += self.speed
        self.speed = self.base_speed + (self.score / 3500)
        self.percentage = min(100, int((self.score / 11500) * 100))
        self.canvas.itemconfig(self.score_txt, text=f"PROGRESS: {self.percentage}%")
        if self.percentage >= 100:
            self.active = False
            self.canvas.create_text(self.w//2, 200, text="THE IMPOSSIBLE CLEARED!", fill="#00ffaa", font=("Arial", 22, "bold"))
            return
        self.angle = (self.angle + 9.0) % 360 if self.is_jumping else round(self.angle / 90) * 90
        if self.py >= self.ground_y - self.p_size: self.py, self.vy, self.is_jumping = self.ground_y - self.p_size, 0, False
        cx, cy, r = self.px + 15, self.py + 15, math.radians(self.angle)
        cos_a, sin_a, h = math.cos(r), math.sin(r), 15
        pts = []
        for lx, ly in [(-h,-h), (h,-h), (h,h), (-h,h)]: pts.extend([cx + (lx * cos_a - ly * sin_a), cy + (lx * sin_a + ly * cos_a)])
        self.canvas.coords(self.player_id, *pts)
        for s in self.spikes: self.canvas.move(s, -self.speed, 0)
        for b in self.blocks: self.canvas.move(b, -self.speed, 0)
        px1, py1, px2, py2 = self.px, self.py, self.px + 30, self.py + 30
        on_plat = False
        for b in self.blocks:
            bbox = self.canvas.bbox(b)
            if bbox:
                bx1, by1, bx2, by2 = bbox
                if px2 > bx1 + 3 and px1 < bx2 - 3:
                    if py2 >= by1 and py2 <= by1 + 12 and self.vy >= 0: self.py, self.vy, self.is_jumping, on_plat = by1 - 30, 0, False, True
                    elif py2 > by1 + 8 and px2 >= bx1 and px1 < bx1: return self.die()
        if not on_plat and self.py < self.ground_y - 30 and self.vy == 0: self.is_jumping = True
        for s in self.spikes:
            c = self.canvas.coords(s)
            if c and len(c) >= 6 and px2 > c[0] + 4 and px1 < c[4] - 4:
                pm = (px1 + px2) / 2
                ratio = (pm - c[0]) / (c[2] - c[0]) if pm <= c[2] else (c[4] - pm) / (c[4] - c[2])
                if py2 > (c[1] - (ratio * (c[1] - c[3]))) + 4: return self.die()
        self.loop_id = self.root.after(16, self.tick)
    def die(self):
        self.active = False
        if self.loop_id: self.root.after_cancel(self.loop_id)
        self.top_scores.append(self.percentage)
        self.top_scores = sorted(list(set(self.top_scores)), reverse=True)[:10]
        while len(self.top_scores) < 10: self.top_scores.append(0)
        self.canvas.create_text(self.w//2, 170, text="TRY AGAIN", fill="#ff4400", font=("Arial", 28, "bold"))
        self.canvas.create_text(self.w//2, 215, text=f"Reached: {self.percentage}%", fill="#fff", font=("Arial", 14))
        self.root.after(850, self.reset)
    def reset(self):
        self.canvas.delete("all")
        self.spikes.clear()
        self.blocks.clear()
        self.vy, self.angle, self.score, self.speed, self.is_jumping, self.active, self.attempt = 0, 0, 0, self.base_speed, False, True, self.attempt + 1
        self.setup()
        self.tick()
if __name__ == "__main__":
    win = tk.Tk()
    UltraImpossibleGame(win)
    win.mainloop()
py34_16
o18, Tháng 6, 2026, 3:58 0

0

geometry dash code

py34_16 đã đăng vào 18, Tháng 6, 2026, 3:56

import tkinter as tk, math class UltraImpossibleGame: def init(self, root): self.root = root self.root.title("The Impossible Game") self.w, self.h, self.sidebarw, self.gravity, self.jumpforce, self.basespeed, self.groundy = 700, 400, 160, 1.5, -16, 8.5, 280 self.vy, self.isjumping, self.angle, self.active, self.loopid, self.score, self.attempt = 0, False, 0, True, None, 0, 1 self.speed = self.basespeed if not hasattr(self, 'topscores'): self.topscores = [0] * 10 self.blocks, self.spikes = [], [] self.tracklayout = [(400, 's'), (650, 's'), (900, 'b'), (930, 'b'), (1150, 's'), (1350, 'b'), (1500, 's'), (2000, 's'), (2030, 's'), (2300, 'b'), (2330, 'b'), (2450, 's'), (2700, 'b'), (2730, 'u'), (3000, 's'), (3030, 's'), (3300, 'b'), (3330, 'b'), (3360, 'b'), (3550, 's'), (3800, 'b'), (3950, 's'), (3980, 's'), (4200, 'b'), (4230, 'b'), (4350, 's'), (4600, 'b'), (4630, 'b'), (4750, 'b'), (4780, 'b'), (4900, 's'), (4930, 's'), (4960, 's'), (5200, 'b'), (5230, 'u'), (5260, 'b'), (5500, 's'), (5700, 'b'), (5730, 'b'), (5760, 'u'), (6000, 's'), (6030, 's'), (6300, 'b'), (6330, 'b'), (6450, 's'), (6480, 's'), (6800, 'b'), (6830, 'b'), (6860, 'b'), (6890, 'u'), (7100, 's'), (7500, 's'), (7530, 's'), (7560, 's'), (7850, 'b'), (7880, 'u'), (7910, 'b'), (7940, 'u'), (8200, 's'), (8400, 'b'), (8430, 'b'), (8550, 's'), (8580, 's'), (8800, 'b'), (8830, 'u'), (9100, 's'), (9130, 's'), (9160, 's'), (9400, 'b'), (9430, 'b'), (9460, 'b'), (9600, 'u'), (9900, 's'), (10200, 'b'), (10230, 'u'), (10500, 's'), (10530, 's'), (11000, 'b'), (11030, 'b'), (11060, 'b'), (11090, 'b'), (11120, 'u')] self.canvas = tk.Canvas(root, width=self.w + self.sidebarw, height=self.h, bg="#001122", highlightthickness=0) self.canvas.pack() self.setup() self.tick() def setup(self): self.scoretxt = self.canvas.createtext(20, 30, text="PROGRESS: 0%", fill="#fff", font=("Arial", 12, "bold"), anchor="w") self.attempttxt = self.canvas.createtext(self.w - 20, 30, text=f"ATTEMPT {self.attempt}", fill="#fff", font=("Arial", 12, "bold"), anchor="e") self.canvas.createline(0, self.groundy, self.w, self.groundy, fill="#fff", width=3) self.canvas.createrectangle(self.w, 0, self.w + self.sidebarw, self.h, fill="#000b14", outline="#00ffff", width=2) self.canvas.createtext(self.w + 15, 30, text="TOP 10 RUNS", fill="#00ffff", font=("Arial", 11, "bold"), anchor="w") for i, val in enumerate(self.topscores): color = "#ffaa00" if i==0 else "#00ffaa" if i<3 else "#8c9ea3" self.canvas.createtext(self.w + 15, 65 + (i * 28), text=f"{i+1}. {val}%", fill=color, font=("Courier New", 11, "bold"), anchor="w") self.psize = 30 self.px, self.py = 120, self.groundy - self.psize self.playerid = self.canvas.createpolygon(0, 0, 0, 0, 0, 0, 0, 0, fill="#ff4400", outline="#fff", width=2) for x, t in self.tracklayout: if t == 's': self.spikes.append(self.canvas.createpolygon(x, self.groundy, x+15, self.groundy-30, x+30, self.groundy, fill="#fff", outline="#001122")) elif t == 'b': self.blocks.append(self.canvas.createrectangle(x, self.groundy-30, x+30, self.groundy, fill="#002244", outline="#00ffff", width=2)) elif t == 'u': self.blocks.append(self.canvas.createrectangle(x, self.groundy-30, x+30, self.groundy, fill="#002244", outline="#00ffff", width=2)) self.spikes.append(self.canvas.createpolygon(x, self.groundy-30, x+15, self.groundy-60, x+30, self.groundy-30, fill="#fff", outline="#001122")) self.root.bind("<space>", lambda e: self.jump()) self.root.bind("<up>", lambda e: self.jump()) def jump(self): if not self.is</up></space>jumping and self.active: self.vy, self.isjumping = self.jumpforce, True def tick(self): if not self.active: return self.vy += self.gravity self.py += self.vy self.score += self.speed self.speed = self.basespeed + (self.score / 3500) self.percentage = min(100, int((self.score / 11500) * 100)) self.canvas.itemconfig(self.scoretxt, text=f"PROGRESS: {self.percentage}%") if self.percentage >= 100: self.active = False self.canvas.createtext(self.w//2, 200, text="THE IMPOSSIBLE CLEARED!", fill="#00ffaa", font=("Arial", 22, "bold")) return self.angle = (self.angle + 9.0) % 360 if self.isjumping else round(self.angle / 90) * 90 if self.py >= self.groundy - self.psize: self.py, self.vy, self.isjumping = self.groundy - self.psize, 0, False cx, cy, r = self.px + 15, self.py + 15, math.radians(self.angle) cosa, sina, h = math.cos(r), math.sin(r), 15 pts = [] for lx, ly in [(-h,-h), (h,-h), (h,h), (-h,h)]: pts.extend([cx + (lx * cosa - ly * sina), cy + (lx * sina + ly * cosa)]) self.canvas.coords(self.playerid, *pts) for s in self.spikes: self.canvas.move(s, -self.speed, 0) for b in self.blocks: self.canvas.move(b, -self.speed, 0) px1, py1, px2, py2 = self.px, self.py, self.px + 30, self.py + 30 onplat = False for b in self.blocks: bbox = self.canvas.bbox(b) if bbox: bx1, by1, bx2, by2 = bbox if px2 > bx1 + 3 and px1 < bx2 - 3: if py2 >= by1 and py2 <= by1 + 12 and self.vy >= 0: self.py, self.vy, self.isjumping, onplat = by1 - 30, 0, False, True elif py2 > by1 + 8 and px2 >= bx1 and px1 < bx1: return self.die() if not onplat and self.py < self.groundy - 30 and self.vy == 0: self.isjumping = True for s in self.spikes: c = self.canvas.coords(s) if c and len(c) >= 6 and px2 > c[0] + 4 and px1 < c[4] - 4: pm = (px1 + px2) / 2 ratio = (pm - c[0]) / (c[2] - c[0]) if pm <= c[2] else (c[4] - pm) / (c[4] - c[2]) if py2 > (c[1] - (ratio * (c[1] - c[3]))) + 4: return self.die() self.loopid = self.root.after(16, self.tick) def die(self): self.active = False if self.loopid: self.root.aftercancel(self.loopid) self.topscores.append(self.percentage) self.topscores = sorted(list(set(self.topscores)), reverse=True)[:10] while len(self.topscores) < 10: self.topscores.append(0) self.canvas.createtext(self.w//2, 170, text="TRY AGAIN", fill="#ff4400", font=("Arial", 28, "bold")) self.canvas.createtext(self.w//2, 215, text=f"Reached: {self.percentage}%", fill="#fff", font=("Arial", 14)) self.root.after(850, self.reset) def reset(self): self.canvas.delete("all") self.spikes.clear() self.blocks.clear() self.vy, self.angle, self.score, self.speed, self.isjumping, self.active, self.attempt = 0, 0, 0, self.base_speed, False, True, self.attempt + 1 self.setup() self.tick() if name == "main": win = tk.Tk() UltraImpossibleGame(win) win.mainloop()

py34_16
o18, Tháng 6, 2026, 3:56 0

-1

WELCOME TO TICA< morons!

py34_16 đã đăng vào 16, Tháng 6, 2026, 14:54

these are no longer humans anymore unless you came from alaska and i believe nobody do so only some people stay in the school because uh ummm tomato is a vegetable and just forget the fact that they have seeds cause cucumbers do to and no non-idiots call them a fruit but you might think that this fact does not relate to how most people leave alaska and that is because it just does and you might wonder why this sentence is so long and now i have to say this again that it just does but now i am tired of typing when it is just 556 characters long but now it went to 579 so i might be typing for a while cause now it is just 637 and i only typed about 60 characters a minute and that is 1 per second plus this sentence is so long and your brain might think why i am typing and expressing my thoughts in the so called rules zone and that is because i like to do so and this place can hold 5 thousand characters for me to type random stuff but the thing is we have just reached 1000 characters yes of course it is exactly 1000 you can check it ending in characters but now i am getting off topic about alaska people and i dont exaclt care because i am typing way too long and i think i should stop here but just one more thing that there are exactly 116 letter e s in this text and um i um hmm er so uhh i huh um what and uhh erm i uh want to say thet um you guys are umm sigma and that is no offensive thoughts.

but attually you guys stink because umm ah erm uh 67 harhar shuriken RIP baby chicken print('doctor lol is dum') um well btw i was joking you guys dont stink lets go gambling yess a flush wait what he has a full house how unfortunately i was all in and now im broke oops

yeah so btw...

WELCOME TO TICA!!

where nerds do blogs post and tutorials and python c++ but cats are cuter ... oops i got of topic ding dong zap blut blortt

umm so where was was I?

oh yeah me making a post

so um er in a umm uhh ehh arr uar uam i think its ... no but ermm urm hurr villager logis be like no wait that not right yeah so once upom a time I have 12 dollars and Fred takes away 7 dollars. What do you have left?

...

wrong!! harahr loser LOL omg youre sooo dumb

the answer is a fight. come seriously use your brains, ok? if someone take your money, your would punchthem right. umm so once upon a time Le Duy beat the top demons called thinking space II and in conclusion, he is fat

also, you are in a race in alaska, you passed 2nd place. which place are you in?

no. you came last because you tripped over an ice cube. Lol

so i guess im out of paper, so this is THE END bye have a great time

also, I founded that there are exactly 183 'E's on this blog.

. you died . score: -1 you were being an idiot

*ps. youre supa gay.

py34_16
o16, Tháng 6, 2026, 14:54 1

dựa trên nền tảng DMOJ | theo dõi VNOI trên Github và Facebook