room topic changed to Keg: Discussion about the esolang Keg. You can ask for golfing advice, new features, beginner questions of Keg, and etc. in this chatroom. (no tags)
It duplicates a number, puts it to the bottom of the stack and then subtracts one from the original. So the stack starts as 9, then becomes 9 8, then 8 9 7
room topic changed to Keg: Discussion about the esolang Keg (documentation:esolangs.org/wiki/Keg). You can ask for golfing advice, new features, beginner questions of Keg, and etc. in this chatroom. (no tags)
Pseudo-solution for Q instruction: ^(:,") Takes input in the reversed order and reverses that input. Then, it iterates through the instructions and prints them.
The first time the & command is called, the top of the stack is stored to the accumulator. The zeroth time it is called, it puts its value to the top of the stack.
I mean when you modulo the number of times you called the & command by 2.
In case you don't know, possibly using the bottom of the stack is shorter. Like let's say I wanted to set the accumulator to 0. For the acc, it'd be 0&, whereas for the bottom the stack it'd be 0.
Let's say you needed to set the bottom of the stack/acc at the beginning of the program to 0, and then run a for loop that runs on every item of the stack. When using the acc you can do 0&( whilst when using the bottom of the stack, you need to do 0"(!1-|
Yeah, the bottom of the stack is one byte shorter at the beginning if you aren't using ! or a for loop that runs the length of the stack times
Hmm, I think creating a Keg tag for this room might be nice.
room topic changed to Keg: Discussion about the esolang Keg (documentation:esolangs.org/wiki/Keg). You can ask for golfing advice, new features, beginner questions of Keg, and etc. in this chatroom. [class] [code-golf] [keg] [practice] [tips]