Vizycraft · Interactive lectures
Vizycraft
Demo
Four ideas you can run, step, and explore, in one offline HTML file
Building a max-heap, stepped
Press Debug, then Step. The tree and the array follow the real execution.
heap = [2, 9, 7, 6, 5, 8]
n = len(heap)
# sift each parent down, from the last one to the root
for start in range(n // 2 - 1, -1, -1):
i = start
while 2 * i + 1 < n:
c = 2 * i + 1
if c + 1 < n and heap[c + 1] > heap[c]:
c += 1
if heap[i] >= heap[c]:
break
heap[i], heap[c] = heap[c], heap[i]
i = c
print(heap)Heap visualization follows the linked Python debugger.
Hybrid orbitals from s and p
Each point is sampled from |ψ|² of a hydrogen-like 2s, 2p, or hybrid orbital.
Colour
Units are Bohr radii. Hybrids are mixed from one 2s and up to three 2p.
Primes on the Ulam spiral
Every integer is sieved exactly. Zoom in and the diagonals stay.
{"title":"Primes on the Ulam spiral","generator":"primes","n":20000,"layout":"ulam","size":1.3}DNA replication at the fork
One new strand grows continuously; the other is made in Okazaki fragments.
Blue and violet: parent strands. Green: leading. Gold: lagging fragments.
What you just did
Every view ran in your browser, from this one file, with no server.
Stepped real code
Python ran line by line and the heap redrew from each step.
Sampled |ψ|²
Orbital clouds came from rejection sampling, not drawings.
Sieved primes
Every integer sieved exactly, laid on a spiral you can zoom.
Moved the fork
Leading and lagging strands grew as you dragged.