Skip to main content
100%

State

✓ Published0🌍 Public
MMTR
Last edited Sep 12, 2021
Created on Aug 25, 2021
Forked from HTML Starter

This interactive visualization illustrates the Collatz conjecture, a sequence where even numbers are halved and odd numbers are tripled and incremented, continuing until reaching 1. A user enters a starting number and presses a button, which triggers a step-by-step animated traversal through six circular state nodes displayed on a grid. Each node highlights and the current value is shown in a text output as the sequence progresses. The visualization uses plain HTML, CSS Grid for the state layout, and the Web Audio API to optionally generate a triangle-wave tone on each step, with the frequency varying based on whether the current number is even or odd. JavaScript timers (setTimeout) control the sequential highlighting of the nodes.

AI-generated description

Collatz .

MIT Licensed

Similar vizzes