|
| 1 | +# Gameplay Documentation |
| 2 | + |
| 3 | +## How to Run |
| 4 | + |
| 5 | +```bash |
| 6 | +python3 main.py |
| 7 | +``` |
| 8 | + |
| 9 | +No external dependencies required. Python 3.x is sufficient. |
| 10 | + |
| 11 | +--- |
| 12 | + |
| 13 | +## Game Flow |
| 14 | + |
| 15 | +### 1. Startup Sequence |
| 16 | + |
| 17 | +When launched, the game prints a themed loading sequence that mimics a Fallout |
| 18 | +terminal, with a short delay between each line (controlled by `EFFECT_WAIT_SEC` |
| 19 | +in `config.json`): |
| 20 | + |
| 21 | +``` |
| 22 | +Excecuting Debug of the secretCodes.db |
| 23 | +
|
| 24 | +initiating preliminary processes |
| 25 | +secretCodes.db -> loaded |
| 26 | +debug process phase 1/2 -> 'OK' |
| 27 | +debug process phase 2/2 -> taking just from 0,122 line |
| 28 | + ...PROCESSING TEXT.. |
| 29 | + decrypting MASTER_PASSWORD |
| 30 | +
|
| 31 | +Extract from the secretCodes.db |
| 32 | +``` |
| 33 | + |
| 34 | +### 2. The Word List |
| 35 | + |
| 36 | +After the startup sequence, the game displays all candidate words on one line: |
| 37 | + |
| 38 | +``` |
| 39 | +jeans ciana lizza vello cesio greve della prude arare |
| 40 | +``` |
| 41 | + |
| 42 | +- Between **4 and 10** words are shown (configurable via `MIN_NUM_WORD` / `MAX_NUM_WORD`). |
| 43 | +- All words have the **same length** (default: 5 characters, set by `LENGHT_PER_WORD`). |
| 44 | +- Words are drawn randomly from the word list file (default: Italian). |
| 45 | +- One of these words is the hidden **master password**. |
| 46 | + |
| 47 | +### 3. Attempts |
| 48 | + |
| 49 | +The number of attempts is calculated as: |
| 50 | + |
| 51 | +``` |
| 52 | +attempts = floor(number_of_candidate_words / DIFFICULTY) |
| 53 | +``` |
| 54 | + |
| 55 | +With the default `DIFFICULTY = 2` and 9 candidate words, the player gets **4 attempts**. |
| 56 | + |
| 57 | +> **Note:** Higher `DIFFICULTY` = fewer attempts = harder game. |
| 58 | +
|
| 59 | +--- |
| 60 | + |
| 61 | +## Player Interaction |
| 62 | + |
| 63 | +Each round the game prompts: |
| 64 | + |
| 65 | +``` |
| 66 | + attempt num > 4 |
| 67 | +verifyFun() insert string -> |
| 68 | +``` |
| 69 | + |
| 70 | +The player types one of the displayed words and presses Enter. |
| 71 | + |
| 72 | +### Valid Input |
| 73 | + |
| 74 | +The guess **must** be one of the words shown on screen. Any other input is rejected: |
| 75 | + |
| 76 | +``` |
| 77 | +INPUT NOT VALID |
| 78 | +``` |
| 79 | + |
| 80 | +--- |
| 81 | + |
| 82 | +## Feedback System |
| 83 | + |
| 84 | +After each **wrong** guess, the game shows how many letters from the guess |
| 85 | +appear **anywhere** in the master password: |
| 86 | + |
| 87 | +``` |
| 88 | +ERROR arare -> 3/5 |
| 89 | +WRONG WORD attempt num > 3 |
| 90 | +``` |
| 91 | + |
| 92 | +This means: 3 out of 5 letters in `arare` are found somewhere in the master |
| 93 | +password. Use this to eliminate or prioritise words. |
| 94 | + |
| 95 | +> **Important:** The hint counts letter *presence*, not *position*. |
| 96 | +> A letter is counted once per occurrence in the guess, regardless of where it |
| 97 | +> sits in the master password. |
| 98 | +
|
| 99 | +### Hint Examples (master password: `jeans`) |
| 100 | + |
| 101 | +| Guess | Hint | Reasoning | |
| 102 | +|---------|------|-----------| |
| 103 | +| `arare` | 3/5 | `a`, `r`, `e` appear in `jeans` (a=yes, r=no, a=yes, r=no, e=yes → 3) | |
| 104 | +| `della` | 2/5 | `e`, `a` appear in `jeans` | |
| 105 | +| `lizza` | 1/5 | only `a` appears in `jeans` | |
| 106 | + |
| 107 | +--- |
| 108 | + |
| 109 | +## End States |
| 110 | + |
| 111 | +### Win — Correct Guess |
| 112 | + |
| 113 | +``` |
| 114 | +ACCESS GRANTED |
| 115 | +A WINNAR IS YUO |
| 116 | +``` |
| 117 | + |
| 118 | +### Lose — Attempts Exhausted |
| 119 | + |
| 120 | +``` |
| 121 | +COMPUTER LOCKED |
| 122 | +
|
| 123 | +NO MORE ATTEMPTS AVAILABLE |
| 124 | +``` |
| 125 | + |
| 126 | +--- |
| 127 | + |
| 128 | +## Full Session Example |
| 129 | + |
| 130 | +Below is a real session trace (9 candidate words, 4 attempts, master = `jeans`): |
| 131 | + |
| 132 | +``` |
| 133 | +Excecuting Debug of the secretCodes.db |
| 134 | +
|
| 135 | +initiating preliminary processes |
| 136 | +secretCodes.db -> loaded |
| 137 | +debug process phase 1/2 -> 'OK' |
| 138 | +debug process phase 2/2 -> taking just from 0,122 line |
| 139 | + ...PROCESSING TEXT.. |
| 140 | + decrypting MASTER_PASSWORD |
| 141 | +
|
| 142 | +Extract from the secretCodes.db |
| 143 | +
|
| 144 | +jeans ciana lizza vello cesio greve della prude arare |
| 145 | +
|
| 146 | + attempt num > 4 |
| 147 | +verifyFun() insert string -> arare |
| 148 | +ERROR arare -> 3/5 |
| 149 | +WRONG WORD attempt num > 3 |
| 150 | +
|
| 151 | + attempt num > 3 |
| 152 | +verifyFun() insert string -> della |
| 153 | +ERROR della -> 2/5 |
| 154 | +WRONG WORD attempt num > 2 |
| 155 | +
|
| 156 | + attempt num > 2 |
| 157 | +verifyFun() insert string -> lizza |
| 158 | +ERROR lizza -> 1/5 |
| 159 | +WRONG WORD attempt num > 1 |
| 160 | +
|
| 161 | + attempt num > 1 |
| 162 | +verifyFun() insert string -> jeans |
| 163 | +ACCESS GRANTED |
| 164 | +A WINNAR IS YUO |
| 165 | +``` |
| 166 | + |
| 167 | +--- |
| 168 | + |
| 169 | +## Configuration Quick Reference |
| 170 | + |
| 171 | +All parameters live in `config.json`: |
| 172 | + |
| 173 | +| Key | Default | Effect | |
| 174 | +|------------------|--------------------------|--------| |
| 175 | +| `NAME_FILE` | `wordListItaliano.txt` | Word list source file | |
| 176 | +| `EFFECT_WAIT_SEC`| `0.1` | Delay (seconds) between startup lines | |
| 177 | +| `MAX_NUM_WORD` | `10` | Maximum candidate words shown | |
| 178 | +| `MIN_NUM_WORD` | `4` | Minimum candidate words shown | |
| 179 | +| `LENGHT_PER_WORD`| `5` | Exact length of all words | |
| 180 | +| `DIFFICULTY` | `2` | Divides candidate count to set attempts | |
| 181 | + |
| 182 | +--- |
| 183 | + |
| 184 | +## Strategy Tips |
| 185 | + |
| 186 | +- Start with words that share **few** letters with each other — this maximises |
| 187 | + the information you gain from the hint. |
| 188 | +- A hint of `0/5` is extremely useful: it eliminates every letter in that word |
| 189 | + from consideration. |
| 190 | +- A hint equal to the word length (e.g. `5/5`) means all letters of your guess |
| 191 | + are present in the master password, though not necessarily in the same order. |
0 commit comments