A magic number is a raw numeric literal whose purpose is unclear because it appears directly in code instead of using a named parameter or variable. section 10.3.3
When a number controls gameplay or another changeable behavior, give it a meaningful parameter or variable name. Assign its concrete value as high-level as possible, such as when the game starts. section 10.3.3
Configurable guessing game
Instead of embedding four digits and 100 guesses inside a function, define the secret-code length and maximum guesses as parameters. Different calls can then change the gameplay without modifying the function. section 10.3.3
When you encounter a raw number, ask:
- Could this number be a parameter or variable with a useful name? section 10.3.3
- Can the value be supplied at the highest appropriate level rather than fixed inside the function? section 10.3.3

