A Theory of Computation coursework project — an interactive Tkinter game that challenges players to type strings matching 9 formal language patterns in 45 seconds. Implements DFA (regex), PDA (stack-based balanced parentheses), and string reversal (palindrome) validators from scratch in pure Python.
Built a Tkinter desktop game for Theory of Computation coursework that validates 9 formal language patterns in real-time as the player types.
Implemented DFA-equivalent validators using Python regex (re module): a*b*, alternating 01, contains 101, ends in 01, a+b+c+, a*b*c*, a*b+c+.
Built a stack-based PDA from scratch (no libraries) to validate balanced parentheses — pushes ( and pops on ), returns True only if stack is empty.
Implemented palindrome detection using Python string reversal (sentence == sentence[::-1]) as a third automaton class.
Scoring system awards +10 for correct answers, deducts -5 for wrong, with a 1-second delay before advancing on failure.
Random sentence selection without repetition (tracks used_sentences), skip button, and real-time ✔️/❌ feedback labels.
Pure Python with zero external dependencies — only stdlib tkinter and re modules used.
Built for Theory of Computation at Lawrence Technological University — the goal was to make abstract automata theory tangible through play.
a*b* — zero or more as followed by zero or more bs (DFA via regex)balanced_parentheses — stack-based PDA, stack must be empty at endpalindrome — string equals its reverse (e.g. "racecar")alternating_01 — matches (01)* — strictly alternatingcontains_101 — any string containing the substring 101ends_in_01 — any binary string ending in 01a+b+c+ — one or more of each, in ordera*b*c* — zero or more of each, in ordera*b+c+ — zero as, at least one b and one c(, pop on ), reject if pop on empty stackused_sentences list prevents repetition until all 9 are exhausted, then resetsroot.after(1000, self.update_clock) — Tkinter-native, no threadingroot.after(1000, self.next_sentence)) to let feedback register