- 1
def heap_sort(a): - 2
n = len(a) - 3
for start in range(n // 2 - 1, -1, -1): - 4
sift_down(a, start, n) - 5
for end in range(n - 1, 0, -1): - 6
a[0], a[end] = a[end], a[0] - 7
sift_down(a, 0, end) - 8
- 9
def sift_down(a, i, n): - 10
while 2 * i + 1 < n: - 11
c = 2 * i + 1 - 12
if c + 1 < n and a[c + 1] > a[c]: - 13
c += 1 - 14
if a[i] >= a[c]: - 15
return - 16
a[i], a[c] = a[c], a[i] - 17
i = c
Lectures that run.
Vizycraft turns a topic or your course notes into one HTML deck where the code executes, the debugger steps, and the diagram follows every line. Press Step and watch.
Bring your own OpenAI key. It stays encrypted and private.
A real deck. Try it here.
This is an exported Vizycraft deck: one HTML file running in your browser. Step through building a heap, spin sp hybrid orbitals, zoom into the primes, and move a DNA replication fork.
Start from what you already teach.
Give the agent a topic, an outline, or your own PDF and Word files. It plans the deck slide by slide, and you approve the plan before anything is written.
- What a heap promisescallout
- Sift down, one step at a timecode + trace
- Heap sort from scratchlab
- Check yourselfquiz
The layout you draw is the layout that ships.
Sketch a slide with placeholders for what goes where. The agent fills them in and never rearranges them, so the slide you planned is the slide you present.
while 2 * i + 1 < n:c = 2 * i + 1if a[i] >= a[c]:return
The interaction is the explanation.
Code runs in the browser in Python, JavaScript, TypeScript, Java, and C++. The step debugger drives the diagrams, and quizzes, labs, and step reveals ask before they tell. Students open the same deck afterwards and work through it on their own.
One file. Works anywhere.
Every deck exports as a single HTML file that opens offline by double-click and behaves exactly as it did in the editor. Or share a link and present from the browser.
- heaps.html one self-contained file
- Runs with no network and no server
- Optional present link to share
Your OpenAI key, kept private.
Vizycraft is bring-your-own-key for now. You add your own OpenAI API key, and the agent uses it for your requests. You pay OpenAI directly for what you use.
- Encrypted on the server with AES-256-GCM and bound to your account.
- Never shared with anyone, and never sent back to your browser. Only its last four characters are shown.
- Used only to call OpenAI for your own work.
Key on file: sk-…Q7xKWe recommend removing your key when you are done. Delete it in Settings, or revoke it in the OpenAI API console, which ends its access everywhere at once.
Open the OpenAI API keys consoleJoin by invitation.
The private beta is open by invite to instructors and TAs building lectures, and to the students they share decks with. The link in your invite email signs you in directly: you set up an authenticator app, then choose a password.