advanced
Narrative Algorithm Transcription
Translate a complex recursive algorithm into a high-tension narrative scene.
📝 提示内容
Translate the logic of a depth-first search (DFS) algorithm navigating a graph into a suspenseful narrative scene. The protagonist represents the traversal algorithm. The nodes of the graph are rooms in an ancient, shifting labyrinth. The edges are corridors. The recursion stack is represented by a magical rope that allows the protagonist to backtrack. Describe the 'marking of visited nodes' as leaving runes to prevent infinite loops. Ensure the narrative flow strictly mirrors the control flow of the DFS algorithm (explore, backtrack, unmark) while maintaining literary tension.