# Example Smart Number Guesser

### ASnake Documentation

A code which generates a random number to guess, then guesses random numbers until it matches. It asks if guess is higher or lower than the number, and based on that adjusts the range of numbers it can guess.

Due to being random, result will likely differ run to run.

## Code:

```
from random import randint
int:
max is 222 ; min is 0
num is randint( min , max )
guess is randint(min,max)
tries 0
while guess isnt num do
if guess > num
max is guess
f'guess {guess} is more than answer'
elif guess < num
min is guess
f'guess {guess} is less than answer'
++tries
while any of max, min are guess
then guess is randint(min,max)
f'number was {num}, took {tries} tries'
```

## (Potential) Result:

```
guess 168 is less than answer
guess 184 is less than answer
guess 197 is more than answer
guess 189 is less than answer
guess 192 is less than answer
guess 194 is less than answer
number was 196, took 6 tries
```