> For the complete documentation index, see [llms.txt](https://centinels.gitbook.io/home/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://centinels.gitbook.io/home/writeups/n00bzctf/misc-addition.md).

# misc/addition

100 points

### Writeup by Aryan

This is the source code we are provided with.

```python
import time
import random

questions = int(input("how many questions do you want to answer? "))

for i in range(questions):
    a = random.randint(0, 10)
    b = random.randint(0, 10)

    yourans = int(input("what is " + str(a) + ' + ' + str(b) + ' = '))

    print("calculating")

    totaltime = pow(2, i)

    print('.')
    time.sleep(totaltime / 3)
    print('.')
    time.sleep(totaltime / 3)
    print('.')
    time.sleep(totaltime / 3)

    if yourans != a + b:
        print("You made my little brother cry ðŸ˜­")
        exit(69)

f = open('/flag.txt', 'r')
flag = f.read()
print(flag[:questions])
```

If we want to solve `-1` questions, then we can get the flag for free!&#x20;

The for loop will never execute, and printing `flag[:-1]` will give us all the characters except the last one (which is probably a newline).

Flag: `n00bz{m4th_15nt_4ll_4b0ut_3qu4t10n5}`
