This is AI Generated focused on visuals not code quality. Raylib-based visual lab for exploring string algorithms as moving geometry instead of static formulas.
strings2.mov
The app ships with four canvases:
1 Borders: prefix function and Z-array on the same sample string2 KMP: animated pattern matching with explicit failure jumps3 Suffix: suffix array ordering plus LCP adjacency structure4 Aho: trie edges, fail links, and multi-pattern scanning
Each page is built around one stable string example and an animated stepper driven by time.
Borders: prefix/suffix reuse becomes visible as copied spans and border arrowsKMP: the pattern row slides across the text while fallback jumps reuse prior workSuffix: lexicographic suffix neighborhoods and repeated substrings show up through LCP highlightsAho: goto edges consume characters, fail links preserve the longest viable suffix state
SPACE pauses the animation so you can inspect a frame without the state advancing.
Every page now also includes:
- a compact pseudocode panel with the currently active lines highlighted
- a short “why this happened” panel that explains the causal reason for the current transition
1234: switch pagesSPACE: pause or resume the animated algorithm stater: reset camera and runtime stateq: quitmouse dragormiddle mouse: panmouse wheel: zoom around cursorhjkl: fine pan nudgesclick minimap: jump camera within the current page
raylib- a C compiler such as
cc/clang - optional:
pkg-configso theMakefilecan auto-detect Raylib flags; otherwise it falls back toRAYLIB_DIR(default/opt/homebrew)
make
make runThis repo is now a reusable shell for deeper string-tech explorations. Useful next pages to add:
- suffix automaton or suffix tree state growth
- rolling hash and substring equality geometry
- Manacher palindrome radii
- wavelet tree or FM-index rank/select views
- edit distance and alignment DP surfaces