Post History
BQN, 8 bytes {π½Β΄1+βπ©} Try it! basic fold builtin version. Use as a dyadic 1-modifier. Longer than APL since evaluated output is shorter than using first class functions. A more fun recursive...
Answer
#3: Post edited
- # [BQN](https://mlochbaum.github.io/BQN/), 8 bytes
- ```
- {π½Β΄1+βπ©}
- ```
- [Try it!](https://mlochbaum.github.io/BQN/try.html#code=X2bihpB78J2UvcK0MSvihpXwnZWpfQoKX2fihpB7MfCdlL17KPCdlajwnZS94oqR8J2VqSkoMTziiaDwnZWpKeKXtuKKo+KAv/CdlYox4oaT8J2VqX0xKzHihpPihpXwnZWpfQoKCgoK4p+oK19mIDUKLV9mIDUKw5dfZiA14p+p)
- basic fold builtin version. Use as a dyadic 1-modifier.
- Longer than APL since evaluated output is shorter than using first class functions.
- A more fun recursive implementation without fold:
- ```
- {1π½{(π¨π½βπ©)(1<β π©)βΆβ£βΏπ1βπ©}1+1ββπ©}
- ```
A previous(wrong) version of this exposed a bug which prevented the program from erroring [here](https://mlochbaum.github.io/BQN/try.html#code=X2bihpB78J2UvcK0MSvihpXwnZWpfQoKX2fihpB7RuKGkPCdlL3ii4QxeyjwnZWoRuKKj/CdlakpKMOX4omg8J2VqSnil7bwnZWO4oC/8J2VijHihpPwnZWpfTErMeKGk+KGlfCdlal9CgoKK19nIDU=).
- # [BQN](https://mlochbaum.github.io/BQN/), 8 bytes
- ```
- {π½Β΄1+βπ©}
- ```
- [Try it!](https://mlochbaum.github.io/BQN/try.html#code=X2bihpB78J2UvcK0MSvihpXwnZWpfQoKX2fihpB7MfCdlL17KPCdlajwnZS94oqR8J2VqSkoMTziiaDwnZWpKeKXtuKKo+KAv/CdlYox4oaT8J2VqX0xKzHihpPihpXwnZWpfQoKCgoK4p+oK19mIDUKLV9mIDUKw5dfZiA14p+p)
- basic fold builtin version. Use as a dyadic 1-modifier.
- Longer than APL since evaluated output is shorter than using first class functions.
- A more fun recursive implementation without fold:
- ```
- {1π½{(π¨π½βπ©)(1<β π©)βΆβ£βΏπ1βπ©}1+1ββπ©}
- ```
- <del>A previous(wrong) version of this exposed a bug which prevented the program from erroring [here](https://mlochbaum.github.io/BQN/try.html#code=X2bihpB78J2UvcK0MSvihpXwnZWpfQoKX2fihpB7RuKGkPCdlL3ii4QxeyjwnZWoRuKKj/CdlakpKMOX4omg8J2VqSnil7bwnZWO4oC/8J2VijHihpPwnZWpfTErMeKGk+KGlfCdlal9CgoKK19nIDU=).</del>
- **EDIT:** [the bug is fixed!](https://github.com/mlochbaum/BQN/commit/a08a343e20ef6c848ce2ea89dc70cbeca72c766d)
#2: Post edited
- # [BQN](https://mlochbaum.github.io/BQN/), 8 bytes
- ```
- {π½Β΄1+βπ©}
- ```
- [Try it!](https://mlochbaum.github.io/BQN/try.html#code=X2bihpB78J2UvcK0MSvihpXwnZWpfQoKX2fihpB7MfCdlL17KPCdlajwnZS94oqR8J2VqSkoMTziiaDwnZWpKeKXtuKKo+KAv/CdlYox4oaT8J2VqX0xKzHihpPihpXwnZWpfQoKCgoK4p+oK19mIDUKLV9mIDUKw5dfZiA14p+p)
- basic fold builtin version. Use as a dyadic 1-modifier.
- Longer than APL since evaluated output is shorter than using first class functions.
- A more fun recursive implementation without fold:
- ```
- {1π½{(π¨π½βπ©)(1<β π©)βΆβ£βΏπ1βπ©}1+1ββπ©}
- ```
A previous(wrong) version of this had a bug which prevented the program from erroring [here](https://mlochbaum.github.io/BQN/try.html#code=X2bihpB78J2UvcK0MSvihpXwnZWpfQoKX2fihpB7RuKGkPCdlL3ii4QxeyjwnZWoRuKKj/CdlakpKMOX4omg8J2VqSnil7bwnZWO4oC/8J2VijHihpPwnZWpfTErMeKGk+KGlfCdlal9CgoKK19nIDU=).
- # [BQN](https://mlochbaum.github.io/BQN/), 8 bytes
- ```
- {π½Β΄1+βπ©}
- ```
- [Try it!](https://mlochbaum.github.io/BQN/try.html#code=X2bihpB78J2UvcK0MSvihpXwnZWpfQoKX2fihpB7MfCdlL17KPCdlajwnZS94oqR8J2VqSkoMTziiaDwnZWpKeKXtuKKo+KAv/CdlYox4oaT8J2VqX0xKzHihpPihpXwnZWpfQoKCgoK4p+oK19mIDUKLV9mIDUKw5dfZiA14p+p)
- basic fold builtin version. Use as a dyadic 1-modifier.
- Longer than APL since evaluated output is shorter than using first class functions.
- A more fun recursive implementation without fold:
- ```
- {1π½{(π¨π½βπ©)(1<β π©)βΆβ£βΏπ1βπ©}1+1ββπ©}
- ```
- A previous(wrong) version of this exposed a bug which prevented the program from erroring [here](https://mlochbaum.github.io/BQN/try.html#code=X2bihpB78J2UvcK0MSvihpXwnZWpfQoKX2fihpB7RuKGkPCdlL3ii4QxeyjwnZWoRuKKj/CdlakpKMOX4omg8J2VqSnil7bwnZWO4oC/8J2VijHihpPwnZWpfTErMeKGk+KGlfCdlal9CgoKK19nIDU=).
#1: Initial revision
# [BQN](https://mlochbaum.github.io/BQN/), 8 bytes ``` {π½Β΄1+βπ©} ``` [Try it!](https://mlochbaum.github.io/BQN/try.html#code=X2bihpB78J2UvcK0MSvihpXwnZWpfQoKX2fihpB7MfCdlL17KPCdlajwnZS94oqR8J2VqSkoMTziiaDwnZWpKeKXtuKKo+KAv/CdlYox4oaT8J2VqX0xKzHihpPihpXwnZWpfQoKCgoK4p+oK19mIDUKLV9mIDUKw5dfZiA14p+p) basic fold builtin version. Use as a dyadic 1-modifier. Longer than APL since evaluated output is shorter than using first class functions. A more fun recursive implementation without fold: ``` {1π½{(π¨π½βπ©)(1<β π©)βΆβ£βΏπ1βπ©}1+1ββπ©} ``` A previous(wrong) version of this had a bug which prevented the program from erroring [here](https://mlochbaum.github.io/BQN/try.html#code=X2bihpB78J2UvcK0MSvihpXwnZWpfQoKX2fihpB7RuKGkPCdlL3ii4QxeyjwnZWoRuKKj/CdlakpKMOX4omg8J2VqSnil7bwnZWO4oC/8J2VijHihpPwnZWpfTErMeKGk+KGlfCdlal9CgoKK19nIDU=).