genuary2026/01/genuary01.py
2026-01-03 08:22:58 +11:00

26 lines
523 B
Python
Executable File

#!/usr/bin/env python
import random
print('<svg width="400" height="400" xmlns="http://www.w3.org/2000/svg">')
for x in range(10):
for y in range(10):
cx = 20 + x * 40
cy = 20 + y * 40
p = random.randint(1, 10)
print(f'<circle cx="{cx}" cy="{cy}" r="5" style="fill:red;">')
anim = f"""
<animate
attributeName="r"
begin="0s"
dur="{p}s"
from="0"
to="40"
repeatCount="indefinite" />
</circle>
"""
print(anim)
print("</svg>")