Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »

Activity for forestbeasts‭

Type On... Excerpt Status Date
Edit Post #281948 Post edited:
Slightly shorter solution!
almost 3 years ago
Edit Post #281948 Post edited:
Language-tag the code blocks for (hopefully) proper syntax highlighting
almost 3 years ago
Edit Post #281948 Initial revision almost 3 years ago
Answer A: Juggler sequences
JavaScript (Node.js), 73 66 bytes This returns a Generator, which calculates the sequence on the fly when you use it! ```js functionf(a){while(a>1){yield a a=(a%2?a1.5:a0.5)} yield a} ``` Original, more aesthetically pleasing but slightly longer version: ```js functionf(a){while(1){y...
(more)
almost 3 years ago
Edit Post #281945 Initial revision almost 3 years ago
Answer A: Shape of an array
JavaScript (Node.js), 51 bytes ``` n=[];f=(a)=>a&&a.map?(n.push(a.length),f(a[0]),n):n ``` Run f on your input, e.g. `f([[],[]])`. Explanation: ``` n=[]; // make a global array to hold the results f=(a)=> // make the function a&&a.map? // is a defined, and an array? (n.push(a...
(more)
almost 3 years ago
Edit Post #281944 Initial revision almost 3 years ago
Answer A: Bytes to Segfault
Swift 5.4, 17 bytes ``` func f(){f()};f() ``` Pretty simple. It just calls itself until it stack overflows. You need to compile and run it, not just do it in the REPL, because the REPL just drops you back into the interpreter once it overflows. It gives a warning "all paths through this fu...
(more)
almost 3 years ago
Edit Post #281943 Initial revision almost 3 years ago
Answer A: Truthify an array
JavaScript (Node.js), 68 bytes ``` f=(a)=>a.map((x)=>[...x.entries()].filter((e)=>e[1]).map((e)=>e[0])) ``` Run the function f on your input, e.g. `f([[1,0,1],[1,0,1],[0,1,0]])`. The output looks like this: ``` [[0, 2], [0, 2], [1]] ``` with one subarray for each input subarray. ...
(more)
almost 3 years ago