Revision d7ad1002-f979-415e-8cc0-a080c57f2c12 - Code Golf Stack Exchange
#dc, 10 - 25 = -15
2?A*Ar^1-n
Takes a blank line for "no input".
Calculates 10 ^ (10 * n) - 1, where n is the input, or 2 if input is empty. Prints a string of `9`s of the required length.
- `2` push 2 to the stack in case input is empty
- `?` push input to the stack
- `A` push 10 to the stack (dc has shortcuts `A`-`F` for 10 - 15)
- `*` pop twice and multiply (multiply input by 10)
- `A` push 10 to the stack
- `r` reverse top two stack elements
- `^` exponentiate 10 ^ (10 * input)
- `1-` subtract 1 from the top of stack
- `n` print with no newline.