13バイト
わずかに異なるアプローチを試み、4バイトを節約しました。
ƇQjȥḶGQɱ⁻Ñ€Ƈ⁻
それを試してみてください:)
使い方
Ƈ # Pushes on the amount of milliseconds passed since 01/01/1970.
Qjȥ # Pushes 2001 onto the stack.
Qj # Pushes on the string "Qj"
ȥ # Converts the string into a number as base 98.
ḶGQɱ⁻Ñ€ # Loops 2001 times printing -1000 to 1000.
Ḷ # Consumes the 2001 and loops the following code 2001 times.
GQ # Pushes on the string "GQ"
ɱ # Pushes on the current counter of the loop (i)
⁻ # Subtracts (i - "GQ") since i is a number, the "GQ" is converted to a number which will fail.
# So, Noodel will treat the string as a base 98 number producing (i - 1000).
Ñ # Consume what is on the top of the stack pushing it to the screen followed by a new line.
€ # The end of the loop.
Ƈ⁻ # Calculates the duration of execution.
Ƈ # Pushes on the amount of milliseconds passed since 01/01/1970.
⁻ # Pushes on (end - start)
17バイト
ƇGQȥḋɲṡ×2Ḷñ⁺1€ÑƇ⁻
それを試してみてください:)
使い方
Ƈ # Pushes on the amount of milliseconds passed since 01/01/1970.
GQȥḋɲṡ×2 # Used to create the range of numbers to be printed.
GQ # Pushes on the string "GQ".
ȥ # Converts the string into number as if it were a base 98 number. (which is 1000)
ḋ # Duplicates the number and pushes it onto the stack.
ɲ # Since the item on top is already a number, makes the number negative (random thing I threw in at the very beginning when made the langauge and totally forgot it was there)
ṡ # Swaps the first two items on the stack placing 1000 on top.
×2 # Doubles 1000 producing... 2000
Ḷñ⁺1€Ñ # Prints all of the numbers from -1000 to 1000.
Ḷ # Consumes the 2000 to loop the following code that many times (now -1000 is on the top).
ñ # Prints the value on top of the stack followed by a new line.
⁺1 # Increment the value on top of the stack by 1.
€ # End of the loop.
Ñ # Since 1000 is still not printed, this consumes 1000 and prints it followed by a new line.
Ƈ⁻ # Calculates the number of milliseconds to execute program.
Ƈ # Pushes on the amount of milliseconds passed since 01/01/1970.
⁻ # Pushes on (end - start) in milliseconds.
# At the end, the top of the stack is pushed to the screen.
スニペットは、完了にそれほど時間がかからないように、値-4〜4を使用しています。
<div id="noodel" code="ƇFȥḶAɱ⁻Ñ€Ƈ⁻" input="" cols="10" rows="10"></div>
<script src="https://tkellehe.github.io/noodel/noodel-latest.js"></script>
<script src="https://tkellehe.github.io/noodel/ppcg.min.js"></script>