Skip to content

Add Mandelbrot generator script and FunStuff UI; update README#242

Open
tomadowley wants to merge 2 commits intomasterfrom
cosine/feature/code-execution
Open

Add Mandelbrot generator script and FunStuff UI; update README#242
tomadowley wants to merge 2 commits intomasterfrom
cosine/feature/code-execution

Conversation

@tomadowley
Copy link
Owner

What this PR adds:

  • A new Mandelbrot image generator script (generate_mandelbrot.py) that uses only the Python standard library and outputs a PPM image. It supports width, height, max iterations, zoom, center, and output path. The script computes smooth color values for nicer rendering and writes the resulting image to disk (e.g., out/mandelbrot.ppm).
  • Example output files added: out/mandelbrot.ppm and out/mandelbrot_small.ppm.
  • A new interactive UI module FunStuff (src/components/FunStuff.tsx) with:
    • Random jokes (client-side, no API calls)
    • Haiku generator with randomized lines
    • Roll a d20 with visual feedback
    • Emoji rain animation
    • All integrated into the App via App.tsx (no external dependencies; purely client-side)
  • Updated App.tsx to render the FunStuff component alongside the existing PrimeChecker.
  • README.md updated with a playful "More Fun" section including Tongue Twister, Palindrome, and a Riddle for quick fun.

How this solves the task:

  • Provides a self-contained Mandelbrot rendering tool that demonstrates code execution and image generation without extra dependencies.
  • Adds an engaging client-side fun panel to showcase lightweight interactive features without requiring back-end services.
  • Keeps the project self-contained and easy to run locally, aligning with the goal of “do something cool that requires code execution” by adding runnable examples.

Usage notes:

  • Mandelbrot: Run the script with desired options, e.g.:
    python3 generate_mandelbrot.py --width 1600 --height 1000 --max-iter 500 --zoom 1.5 --center -0.75 0.0 --output out/mandelbrot.ppm
    The output is a PPM image at the specified path.
  • UI: Start the app as usual; in the UI you can generate jokes, haikus, roll dice, and trigger emoji rain via the new FunStuff card.

This pull request was co-created with Cosine Genie

Original Task: sorbox/h5nayvl0d0xg
Author: Tom Dowley

tomadowley and others added 2 commits January 15, 2026 12:54
…and include example outputs under out/

Co-authored-by: Cosine <agent@cosine.sh>
…un examples

Co-authored-by: Cosine <agent@cosine.sh>
@vercel
Copy link

vercel bot commented Jan 15, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
sorbox Ready Ready Preview, Comment Jan 15, 2026 0:58am

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant