I'm just saying, commands are usually so long in Python that something that needs to be done in 100 bytes in Python can easily be done in 10-20 bytes in other esolangs.
@QPaysTaxes I would say a data stack for every scope, so that you can use one variable in one scope and use the same variable in another scope, without any exceptions being raised. That would make things a whole lot more convenient.
So I would do something like $ puts "number 2" to output "thing: number 2".
So inside the inner block (in between the {}) I would call $ puts "number 2" to output "thing: number 2". However, if I called it outside the block, I can't.
So {} defines blocks, and put defines functions, with "put" being the name of the function in the inner block. Nice!
Yeah, that's what I meant.
Then what the the call do?
Oh, nice.
Once the block is exited, it's like it was never there. It's gone.
You can call it once, and that's it.
So you can call the block again, anytime you want with call?
So call simply calls the latest block on the stack?
And by removing it, I am guessing you mean that once its called, its gone.
Wound't it be better to simply create a stack where all the blocks are enumerated, and then you can simply call any block you want by doing, for example, call {number of block}? That way, you won't have to dup it, redefine it, or store it in a variable.
And, maybe doing, for instance, show calls can show all the defined blocks? Then there can be a separate global stack for global words.
I am thinking more along a dictionary than a plain old stack.
Each number stores the scope for each specific block. Nothing has to be stored in a variable, redefined, or duplicated. Just simply call the correct number from the dict.
@QPaysTaxes Well, like I said, enumerate them all in a hash table, for instance, so you won't have to remove the block every time it's called. Just do call {block number}
> There can't possibly be a built-in for this, but just in case there is (looking at you Mathematica), the use of built-ins that directly solve this are prohibited.
Introduction
Given an input of a block of string containing 1 or more of each character in !@#$^&*, output in any reasonable format the coordinates of the switch(es) that is/are "on".
A switch is a $, and a switch is "on" if and only if it satisfies at least 1 of the following criteria:
It ...
In chess, Forsyth-Edwards Notation, more commonly called "FEN", is a textual way of transcribing boards. It describes each of the board's eight rows (called "ranks" in chess) from top to bottom from White's perspective. The pieces are written as K (king), Q (queen), R (rook), B (bishop), N (knigh...
@AshwinGupta using labmdas is ok. The best way is to use something like grunt or gulp, which you can use to automate the build of your code, which you can use with a CI to get normal JS code automatically!
I tried to do a brainbool program and got this error on TIO, @Dennis:
/opt/tio-transpilers/brainbool: line 3: code.c: Permission denied
/opt/tio-transpilers/brainbool: line 23: code.c: Permission denied
/opt/tio-transpilers/brainbool: line 25: code.c: Permission denied
cc: error: code.c: No such file or directory
cc: fatal error: no input files
compilation terminated.
Command exited with non-zero status 4
Elapsed time: 0.00 s
@CᴏɴᴏʀO'Bʀɪᴇɴ, do you think this is fair? I'll accept it if: it has an esolang/wiki article, available interpreter and documentation, and has been used by at least two users on PPCG prior to the answer on the versatile integer printer challenge.
@CᴏɴᴏʀO'Bʀɪᴇɴ Uh, I just changed a couple of things on TIO for the Julia interpreter, and I didn't realize how much it would impact the others. That should be fixed now.
@CᴏɴᴏʀO'Bʀɪᴇɴ, no. It must have been used prior to using it in the challenge. I.e. if it's created today, you must wait until two users (including you) have used it on other challenges on this site.