CARVIEW |
Select Language
HTTP/2 200
date: Sun, 12 Oct 2025 23:33:50 GMT
content-type: text/html; charset=UTF-8
server: cloudflare
x-frame-options: DENY
x-content-type-options: nosniff
x-xss-protection: 1;mode=block
vary: accept-encoding
cf-cache-status: DYNAMIC
content-encoding: gzip
set-cookie: _csrf-frontend=a36568ee381e6bf45c60083fd3840e73ba932f3914b028a7eeba08bd29302189a%3A2%3A%7Bi%3A0%3Bs%3A14%3A%22_csrf-frontend%22%3Bi%3A1%3Bs%3A32%3A%22PERLfm_EEDuHHXk6iS7LCx989FxRcHJe%22%3B%7D; HttpOnly; Path=/
cf-ray: 98da678b9d5f5ace-BLR
# tk_Walk_8_Colors.py - Pastebin.com
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # tk_Walk_8_Colors.py
- import tkinter as tk
- from PIL import Image, ImageTk
- import random
- WW, HH = 600, 600
- GRID_SIZE = 10
- ROWS, COLS = HH // GRID_SIZE, WW // GRID_SIZE
- root = tk.Tk()
- root.geometry(f"{WW}x{HH}+0+0")
- canvas = tk.Canvas(root, width=WW, height=HH)
- canvas.pack()
- colors = [(255, 255, 255), # White
- (255, 255, 0), # Yellow
- (0, 255, 0), # Green
- (255, 165, 0), # Orange
- (128, 128, 128), # Gray
- (0, 0, 255), # Blue
- (255, 0, 0), # Red
- (128, 0, 128)] # Purple
- num_colors = len(colors)
- image = Image.new("RGB", (COLS, ROWS), "white")
- xy = {}
- def reset_canvas(event=None):
- global image_data, ants, directions
- image_data = colors * (ROWS * COLS // num_colors)
- random.shuffle(image_data)
- ants = {i: (ROWS // 2, COLS // 2) for i in range(num_colors)}
- directions = {}
- for color in colors:
- directions[color] = random.sample(colors, len(colors))
- root.bind("<space>", reset_canvas)
- reset_canvas(0)
- while True:
- for i in range(num_colors):
- ant_x, ant_y = ants[i]
- idx = idx = ant_y * COLS + ant_x
- color = image_data[idx]
- if color == "white":
- ant_direction = colors.index(colors[i]) % 4
- else:
- ant_direction = directions[colors[i]].index(color) % 4
- if ant_direction == 0:
- ant_x += 1
- elif ant_direction == 1:
- ant_x -= 1
- elif ant_direction == 2:
- ant_y += 1
- elif ant_direction == 3:
- ant_y -= 1
- ant_x %= ROWS
- ant_y %= COLS
- ants[i] = (ant_x, ant_y)
- image_data[idx] = colors[i]
- image.putdata(image_data)
- photo = ImageTk.PhotoImage(image.resize((WW, HH), resample=Image.NEAREST))
- canvas.create_image(0, 0, image=photo, anchor=tk.NW)
- root.update()
- root.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
-
💡 EASY MONEY GUIDE ✅ Working
JavaScript | 2 sec ago | 0.24 KB
-
🔥 Exchange profit method
JavaScript | 13 sec ago | 0.24 KB
-
📝 MAKE $2500 IN 15 MIN ✅ Working
JavaScript | 23 sec ago | 0.24 KB
-
📌 Swapzone +37% glitch ⭐ J
JavaScript | 25 sec ago | 0.25 KB
-
⭐⭐⭐Exchange Exploit⭐⭐
Java | 29 sec ago | 0.15 KB
-
⚡ Crypto Swap Glitch ✅ Working ⚡
JavaScript | 32 sec ago | 0.24 KB
-
✅⭐ Make huge profits on trading ⭐⭐ 5
JavaScript | 34 sec ago | 0.25 KB
-
⭐⭐⭐Free Giftcards Method⭐⭐
Java | 40 sec ago | 0.15 KB
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand