Skip to content

Latest commit

 

History

History
142 lines (103 loc) · 5.82 KB

README.en.md

File metadata and controls

142 lines (103 loc) · 5.82 KB

🇮🇱 גרסה עברית: README.md

🎭 Tom Riddle's Diary

A fake "AI chatbot" and an unbeatable Tic-Tac-Toe game that run entirely inside Microsoft Word — using nothing but AutoCorrect. No internet, no add-ins, no macros required at runtime.

Tom Riddle is a prank. To an audience it looks like Word is talking back to you and playing games. In reality, every "reply" is just an AutoCorrect replacement that Word swaps in as you type. It even works on a fully offline / locked-down machine.

🤫 The whole trick is that it's not AI. If you're performing it, don't tell your audience how it works — none of the built-in responses give it away.


✨ Features

  • 💬 ~280 chat sentences — type natural Hebrew sentences ("מה נשמע", "מי אתה", "ספר לי בדיחה", "אני עצוב"...) and get replies that sound like a real assistant.
  • ❓ Follow-up questions — "בוא נשחק" asks whether you want to play (yes/no), riddles reveal their answer on request, and every finished game offers a rematch.
  • 🎮 Full Tic-Tac-Toe against a perfect (unbeatable) computer — all 1,120 reachable board states are pre-computed. Best you can do is a draw.
  • 🌐 100% offline & local. Works with network/macros blocked.
  • ↩️ Clean uninstall that restores Word exactly.
  • 🖱️ One-click installer (.vbs) or manual import (.bas).

🚀 Install

Option A — One click (easiest)

  1. Download the repo (Code → Download ZIP) and unzip.
  2. Double-click easy-install/Install-TomRiddle.vbs.
  3. A popup says "תום רידל מוכן!" — you're done.

The script automates Word to add the entries. Windows or antivirus may ask you to confirm running a script — that's expected. If scripts are blocked on your machine, use Option B.

Option B — Manual import (most reliable)

  1. Open Word → press Alt + F11 (VBA editor).
  2. File → Import File… → choose src/TomRiddle_Setup.bas.
  3. Press F5 → run TomRiddle_Install.

⚠️ Import the .bas file — do not copy-paste it into the code window (the first Attribute VB_Name line will cause a Syntax error).


🕹️ Usage (all triggers are in Hebrew)

Type the phrase, then a space, and Word replaces it.

Chat — try:

  • מה נשמע — small talk
  • מי אתה / איך קוראים לך — identity
  • ספר לי בדיחה — a joke
  • תן חידה — a riddle (type מה התשובה for the answer)
  • אני עצוב — empathy mode

(Full list: docs/replacements.txt)

Tic-Tac-Toe:

  • Type בוא נשחק → it says Tic-Tac-Toe is all it knows for now and asks if you want to play. Type כן (or יאללה/בטח) and a space → a board (a real table) appears. You are X, the computer is O.
  • Each turn: at the end of the "המהלך שלך הוא- " line, type just the cell digit (as shown on the board) and a space — the next board appears by itself. No codes, nothing to remember.
  • When a game ends it offers a rematch — כן + space opens a fresh board.
  • What you type after a question/board may not show on screen — that's intentional.
  • Typed a wrong digit (occupied cell)? Backspace and type again. Always a space, never Enter.

Your audience sees a live conversation, boards appearing "on their own", and the "AI" winning. 😈


🧠 How it works

Word's AutoCorrect replaces text as you type. Tom Riddle registers a large set of formatted replacements: fixed phrases for chat, and a real-table board per game state. Because AutoCorrect is stateless, every board plants a hidden token (Hidden-formatted text) at the end of its "המהלך שלך הוא- " line, encoding the whole game so far; the digit you type joins it to form the next board's trigger. Word's matcher reads the document text — hidden runs and the space left by the previous fire included — so the chain sustains itself.

Three non-obvious quirks this project works around:

  1. Formatted entries are global. Plain-text entries live in per-language lists, and entries added via automation land in a list your typing may never consult — so everything here is a formatted entry (which also lifts the 255-char value cap).
  2. Loop prevention. Word won't apply a replacement whose result contains its own trigger — so each board's new token encodes the history reversed, guaranteeing the trigger that just fired never appears in the result.
  3. A table inserted mid-line swallows the text before it — so every board value starts with a paragraph mark.

🧹 Uninstall

  • One click: double-click easy-install/Uninstall-TomRiddle.vbs.
  • Manual: import src/TomRiddle_Remove.bas and run TomRiddle_Uninstall.

Both remove every Tom Riddle entry (plus a safety sweep of anything left over) and leave your AutoCorrect exactly as it was.


🛠️ Development

Everything is generated by one script:

python3 generate_tomriddle.py

Edit the CHAT list inside it to add or change responses, then re-run to regenerate the .bas and .vbs files. The Tic-Tac-Toe tree (perfect play via minimax) and all Hebrew text (encoded as ChrW code points so the source stays pure ASCII) are built automatically.


⚠️ Notes

  • Tom Riddle only edits your AutoCorrect entries; the uninstaller reverts them.
  • Boards are real Word tables (formatted AutoCorrect entries) — red X, blue O, real borders. Looks great in any font; no document setup needed.
  • Install takes ~3-4 minutes (~1,430 formatted entries get registered) and ends with a popup reporting how many boards were saved. Uninstall is fast.
  • This is a toy/prank. Use it to have fun. 🙂

📄 License

MIT — see LICENSE.