Activity for forestbeastsâ€
| Type | On... | Excerpt | Status | Date |
|---|---|---|---|---|
| Edit | Post #296242 | Initial revision | — | 3 months ago |
| Answer | — |
A: Single letter HTML Perl, 9 bytes ``` /[abipq]/ ``` Perl's got an `m//` operator (which you also get if you use a bare regex, like here) that by default matches on `$`. Returns true if it matches, false if it doesn't. The regex itself isn't anything special. If you wanted to actually use it, you could ... (more) |
— | 3 months ago |
| Edit | Post #281948 |
Post edited: Slightly shorter solution! |
— | over 5 years ago |
| Edit | Post #281948 |
Post edited: Language-tag the code blocks for (hopefully) proper syntax highlighting |
— | over 5 years ago |
| Edit | Post #281948 | Initial revision | — | over 5 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(... (more) |
— | over 5 years ago |
| Edit | Post #281945 | Initial revision | — | over 5 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.pu... (more) |
— | over 5 years ago |
| Edit | Post #281944 | Initial revision | — | over 5 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 thi... (more) |
— | over 5 years ago |
| Edit | Post #281943 | Initial revision | — | over 5 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) |
— | over 5 years ago |
