This probe measures how long it takes you to read a small function and predict its output. You will see 10 short functions, half in Python, half in a new language called proto-a v3. Each function is followed by an input; your job is to enter what the function returns for that input.
Total time: ~15 minutes. Each problem has a timer (your time is recorded). There are no negative consequences for wrong answers; this is not a test of your skill, only a measurement of relative comprehension time and correctness.
Before you start, please skim the proto-a v3 spec below.
[show / hide proto-a v3 spec]
# proto-a v3 — minimal spec for code generation
proto-a v3 is an English-base programming language designed for joint readership by humans, machines, and large language models. Use it as you would Python; the differences are surface form, not semantics.
## Statements
- **Imports.** `use X.` for `import X`. `use Y from X.` for `from X import Y`.
- **Function definition.** `binder NAME of ARG1, ARG2:` for `def NAME(ARG1, ARG2):`. With no arguments: `binder NAME:`.
- **Assignment.** `bind X to V.` for `X = V`.
- **Augmented assignment.** `add V to X.` for `X += V`.
- **Return.** `give X.` for `return X`.
- **Print.** `say X.` for `print(X)`.
## Control flow
- **If / elif / else.** `if X then` / `elif X then` / `else:`. Each opens a block; body is indented on the next line.
- **Unless.** `unless X then` is `if not X:` (block opener; body indented).
- **While / until.** `while X:` (Python-style). `until X:` is `while not X:`.
- **For / loop.** `loop X in Y:` for `for X in Y:`. `loop X, Y in Z:` for tuple unpacking. `loop X from A to B:` for `for X in range(A, B + 1):` (inclusive on both ends, ASCENDING only). For descending iteration: `loop X from A down to B:` for `for X in range(A, B - 1, -1):` (inclusive on both ends, DESCENDING).
- **Try / catch.** `try` opens the try block; `catch ERR as e:` for `except ERR as e:`.
## Expressions
- **Equality.** `X is Y` for `X == Y`. `X is not Y` for `X != Y`. `X is none` for `X is None`.
- **Comparisons.** `over` for `>`. `less than` for `<`. `more than` for `>`. Also `<`, `>`, `<=`, `>=`, `==`, `!=` (Python symbols) all valid.
- **Arithmetic.** Use `+`, `-`, `*`, `/`, `%`, `**` (Python symbols).
- **Divisibility predicate.** `divisible X by N` for `(X % N == 0)`. When X is a multi-term expression, parenthesise: `divisible (a + b) by 3`, NOT `divisible a + b by 3`.
- **Boolean.** `and`, `or`, `not` (Python).
- **Literals.** `none`, `true`, `false` (lowercase, mapped to None, True, False).
## Borrowed from Python verbatim
- Dict literals `{"k": v}`, list literals `[a, b]`, indexed access `X[k]`, attribute access `X.attr`.
- Method calls `obj.method(args)` (Python style).
- f-strings `f"... {X} ..."`.
- List comprehensions `[expr for X in Y if Z]`.
- Lambda `lambda X: Y`.
- Decorators `@decorator`.
- Class definitions `class X(Y): pass`.
- `range(...)`, `len(...)`, `int(...)`, `str(...)`, `isinstance(...)`, etc.
## Style
- One statement per line. Use indentation for blocks (spaces, consistent).
- Multi-line block form preferred. End-of-statement `.` is optional but common.
- No trailing `;`. Use newlines.
## Example: fizzbuzz
```
loop i from 1 to 100:
if divisible i by 15 then
say "FizzBuzz".
elif divisible i by 3 then
say "Fizz".
elif divisible i by 5 then
say "Buzz".
else:
say i.
```
## Example: factorial
```
binder factorial of n:
if n <= 1 then
give 1.
else:
give n * factorial of n - 1.
say factorial of 5.
```
Note: the function-call style `NAME of ARGS` (e.g. `factorial of n - 1`) is the proto-a-native call form. Python-style `NAME(ARGS)` (e.g. `factorial(n - 1)`) is also accepted.