1+, 256 255 64 61 59 56 50 48 bytes
10
42
..(|(A|";";";";";)(A)^";^)(B|()()())(B)(B)
I'm lazy. Pushes a newline and an asterisk, then simply output them, without any tricks. No loops because creating terminating loops in 1+ is painful.
EDIT: -1 byte by reusing the constant 2
.
EDIT: -191 bytes by using functions.
EDIT: -3 bytes by using another function.
EDIT: -2 bytes using one more function.
EDIT: -3 bytes.
EDIT: -6 bytes, although it probably doesn't quite follow the rules. It outputs number:
followed by the correct output, but number:
is a input prompt. If the input prompt have to be counted as output, then all answers with input is invalid as well.
This exploits a weird behaviour of the interpreter. When run in TIO with argument .input.tio
, it reads from the input for the program source code and reads from the input again for the program input. So, yeah, the source code is fed into the input itself. 42
is a nope NOP because the only number literal 1+ recognises is 1
. .
pushes the input as an integer, which is 42.
If the character was something other than *
it can be 46 bytes, by reading a character, not integer (*
cannot precede the program due to the empty stack)
This will be completely valid after TwilightSparkle Edition is out. (TSE have a "-o" command line option that runs the original interpreter, except there are no prompts.)
EDIT: -2 bytes. Same trick with 10.