ArticlesProjectsWeeklyCredentialsAbout

TMC #0015: Turing Test: Imitation Game Simulator

A pure-Python simulation of Turing's 1950 imitation game: a rule-based chatbot and scripted human compete across a 20-question bank, scored by a heuristic interrogator that awards rounds based on answer plausibility.

turing-testturingimitation-gamechatbotnatural-languagepythonphilosophy

Turing's 1950 paper replaced "can machines think?" with a concrete game: fool a human interrogator. This project implements that game as a runnable experiment.

What It Includes

RuleBasedChatbot: A keyword-matching machine player with 18 response rules covering all major question categories: arithmetic, creative writing, chess, philosophy, introspection, and opinion. Responses are calibrated to sound human: evasive on hard questions, specific on easy ones.

ScriptedHuman: A scripted human baseline with natural, idiosyncratic answers including hesitation markers, personal anecdotes, and deliberate inconsistencies: the kind of response a real person gives rather than an information-retrieval system.

run_game: The interrogation loop: 20 questions from Turing's own examples and extensions, scored by a heuristic judge that awards rounds based on specificity, length, and plausibility (with a random element to simulate interrogator uncertainty).

Scoring analysis: Prints each question, both responses (truncated to 80 chars), the judge's verdict, and a final pass/fail based on whether the machine wins more rounds than the human.

Running It

python turing_test_sim.py              # full 20-question game
python turing_test_sim.py --demo basic # 5-question demo

No external dependencies: pure Python 3.10+.

Source code
# TMC #0015 — Turing Test: Imitation Game Simulator

Companion code for [The Thinking Machine Chronicles #0015](/articles/tmc-0015-turing-test-computing-machinery).

Simulates the imitation game from Turing's 1950 paper: a rule-based chatbot and a scripted human compete across a 20-question bank, scored by a heuristic interrogator.

## Usage

```bash
python turing_test_sim.py              # full 20-question game
python turing_test_sim.py --demo basic # 5-question demo
python turing_test_sim.py --demo full  # all 20 questions with scoring
```

Pure Python 3.10+, no external dependencies.