Activity for Shaggy
Type | On... | Excerpt | Status | Date |
---|---|---|---|---|
Edit | Post #283417 | Initial revision | — | over 3 years ago |
Answer | — |
A: Small integer swapping Japt, 3 bytes I/O as an array. cUé Try it cUé :Implicit input of array U c :Concatenate Ué : U rotated right once (more) |
— | over 3 years ago |
Comment | Post #283379 |
Another option would be to enter them as a single argument and then add something in the header to manipulate them into the format you need. (more) |
— | over 3 years ago |
Comment | Post #283380 |
And I don't think you need the `#include`s, seems to work without them. (more) |
— | over 3 years ago |
Comment | Post #283380 |
Here's a TIO for you: https://tio.run/##XVFBbtswELznFYp7kSg6qJFLUFnJQ4IcqCVlLUKR6pKUkRp@u8KlWyDpgRhqOLszGMEerHKnbfuBDmzSpjqGqNE/TM933yiLw/8coTsxB5OiCvuDFALy0VLE18efb/1lR0bv5O7DWOvP@XIiY1zGgfyZMYAiayIzVsF7Rg8TmYyLUTBlpDR8MG1xZXpFf9OPqiywmOd4sbdsBJMHb1Vk6axSGQEyai6Ic/DFFe1qiJf7wAr1JxVPa@byTimEYpLjsvmSa... (more) |
— | over 3 years ago |
Edit | Post #283376 | Initial revision | — | over 3 years ago |
Question | — |
Coat of Many Colours Challenge Given a list of unique colour names as input, sort them in the order that they first appear in Joseph's Amazing Technicolour Dreamcoat. Example Input: green, blue, red, brown Output: red, green, brown, blue The full list of colours, in order, is: 1. red 2. ... (more) |
— | over 3 years ago |
Edit | Post #283357 | Initial revision | — | over 3 years ago |
Answer | — |
A: Juggler sequences Japt, 17 bytes Needs some more work. É?[U]cßÂUp½+Uu:1ì Try it If there's a proof that the length of the sequence for any given `n` never exceeds `n3` then ... Japt, 14 bytes NcU³Æ=Âp½+UuÃâ Try it (more) |
— | over 3 years ago |
Edit | Post #283355 |
Post edited: |
— | over 3 years ago |
Edit | Post #283355 | Initial revision | — | over 3 years ago |
Answer | — |
A: Juggler sequences JavaScript, 37 32 bytes Outputs a comma delimited string. f=n=>n-1?n+[,f(n(.5+n%2)|0)]:n Try it online! (more) |
— | over 3 years ago |
Edit | Post #283344 |
Post edited: |
— | over 3 years ago |
Edit | Post #283345 | Initial revision | — | over 3 years ago |
Answer | — |
A: Getting perfect squares, differently JavaScript (V8), 28 bytes for(x=y=0;;++y)print(x+=++y) Try it online! (more) |
— | over 3 years ago |
Edit | Post #283344 | Initial revision | — | over 3 years ago |
Answer | — |
A: Getting perfect squares, differently Japt, 9 bytes No infinite lists in Japt so we'll have to go with a recursive solution. ßOpTµJJµ2 Test it ßOpTµJJµ2 ß :Recursive call with (irrelevant) argument Op : Output with trailing newline (returns undefined and second argument is ignored) ... (more) |
— | over 3 years ago |
Edit | Post #283128 |
Post edited: |
— | over 3 years ago |
Edit | Post #283310 |
Post edited: |
— | over 3 years ago |
Edit | Post #283310 |
Post edited: |
— | over 3 years ago |
Edit | Post #283314 | Initial revision | — | over 3 years ago |
Answer | — |
A: Are All Elements Equal? Rockstar, 76 bytes Takes individual integers as input. listen to f let n be f o's1 while n let o be o and n is f listen to n say o Try it (Code and input will need to be added manually, with each input integer on its own line) (more) |
— | over 3 years ago |
Edit | Post #283311 |
Post edited: |
— | over 3 years ago |
Edit | Post #283311 |
Post edited: |
— | over 3 years ago |
Edit | Post #283311 | Initial revision | — | over 3 years ago |
Answer | — |
A: Are All Elements Equal? JavaScript, 20 bytes Outputs `false` for truthy and `true` for falsey. a=>a.some(x=>x-a[0]) Try it online! Outputs `true` and `false` as normal. a=>new Set(a).size<2 Try it online! (more) |
— | over 3 years ago |
Edit | Post #283310 | Initial revision | — | over 3 years ago |
Answer | — |
A: Are All Elements Equal? Japt, 3 bytes e¡g Try it e¡g :Implicit input of array U e :Is equal to ¡ :Map U g : First element of U (more) |
— | over 3 years ago |
Edit | Post #282293 |
Post edited: |
— | over 3 years ago |
Comment | Post #281574 |
You might want to verify that that input format is acceptable. (more) |
— | over 3 years ago |
Edit | Post #283273 |
Post edited: |
— | over 3 years ago |
Edit | Post #283275 |
Post edited: |
— | over 3 years ago |
Edit | Post #283275 | Initial revision | — | over 3 years ago |
Answer | — |
A: Reduce over the range [1..n] JavaScript, 25 bytes The function is called with `f(g)(n)`, where `g` is a function. g=>h=n=>n-1?g(h(n-1),n):1 Try it online! (more) |
— | over 3 years ago |
Edit | Post #283273 |
Post edited: |
— | over 3 years ago |
Edit | Post #283273 | Initial revision | — | over 3 years ago |
Answer | — |
A: Reduce over the range [1..n] Japt, 4 bytes Takes the operator as a string but would also work without modification using a function by assigning it to variable `V`. That can be done in the header by leaving a blank line and then entering a function in the form `XY{X[op]Y}`, where `[op]` is the operator or method. õ rV ... (more) |
— | over 3 years ago |
Edit | Post #283171 |
Post edited: |
— | over 3 years ago |
Comment | Post #283179 |
It also, unfortunately, fails on this point: "Output should be one of two _consistent_ truthy/falsey values" (more) |
— | over 3 years ago |
Comment | Post #283179 |
This fails for `0`, which should return a truthy value. (more) |
— | over 3 years ago |
Comment | Post #283231 |
Is `/` regular division or integer division? (more) |
— | over 3 years ago |
Comment | Post #283175 |
Can we take the operators themselves as a string input? (more) |
— | over 3 years ago |
Comment | Post #283137 |
No, the task is to output a truthy or falsey _value_. Any non-empty string is truthy. (more) |
— | over 3 years ago |
Edit | Post #283171 | Initial revision | — | over 3 years ago |
Answer | — |
A: Guess the language! (Cops' Thread) Jelly, cracked by m90 13 bytes Should be pretty simple - I'm running out of ideas; one of the downsides of only golfing in 2 languages! “¿×⁶ṆḶN{N=ȷṾ» Try it online! (more) |
— | over 3 years ago |
Edit | Post #283158 |
Post edited: |
— | over 3 years ago |
Comment | Post #283160 |
Nice one, @#54118 :) I obviously didn't include enough red herrings; thought the extra `+` at the start of the brainfuck code to override the `x-y` might have thrown people, too. (more) |
— | over 3 years ago |
Edit | Post #283160 |
Post edited: |
— | over 3 years ago |
Comment | Post #283135 |
And looks like you figured out the link, too :) (more) |
— | over 3 years ago |
Edit | Post #283135 |
Post edited: |
— | over 3 years ago |