sh, sw = stdscr.getmaxyx()
drops = [random.randint(0, sw - 1) for _ in range(100)]
stdscr.clear()
while True:
stdscr.clear()
for i in range(100):
x = drops[i]
y = random.randint(0, sh - 1)
stdscr.addstr(y, x, "|", curses.color_pair(1))
drops[i] = (x + random.randint(-1, 1)) % sw
stdscr.refresh()
time.sleep(0.1)
import os import random import time import curses
def start_blue_rain(stdscr): curses.start_color() curses.init_pair(1, curses.COLOR_BLUE, curses.COLOR_BLACK)
def main(): curses.wrapper(start_blue_rain)
if name == "main": main()