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 »

Posts by Shaggy‭

109 posts
75%
+4 −0
Challenges Collatz conjecture; Count the tries to reach $1$

JavaScript, 28 bytes f=n=>n-1&&-~f(n%2?n*3+1:n/2) Try it online!

posted 2y ago by Shaggy‭

Answer
66%
+2 −0
Challenges Collatz conjecture; Count the tries to reach $1$

Japt, 15 bytes É©Òß[U*3ÄUz]gUv Try it É©Òß[U*3ÄUz]gUv :Implicit input of integer U É :Subtract 1 © :Logical AND with Ò :Negate the ...

posted 2y ago by Shaggy‭  ·  edited 2y ago by Shaggy‭

Answer
60%
+1 −0
Challenges Reverse an ASCII string

Rockstar, 67 bytes listen to S split S O's"" while S roll S into C let O be C+O say O Try it here (Code will need to be pasted in)

posted 2y ago by Shaggy‭

Answer
60%
+1 −0
Challenges Evens or Odds - you know this one

Rockstar, 44 bytes Outputs 1 for odd or 0 for even. listen to N let M be N/2 turn up M say M*2-N Try it here (Code will need to be pasted in)

posted 2y ago by Shaggy‭

Answer
50%
+0 −0
Challenges A number adder, not a death adder

Rockstar, 40 bytes listen to N say "listen to N say N-0+"+N Which outputs P2, where X is the input from P1: listen to N say N-0+X Try it here (Code will need to be pasted in)

posted 2y ago by Shaggy‭

Answer
66%
+2 −0
Challenges Repeat the characters

Rockstar, 90 bytes listen to S split S listen to N O's"" while S roll S into C let C be*N-0 let O be+C say O Try it here - code will need to be pasted in; s goes on the first line of ...

posted 2y ago by Shaggy‭

Answer
66%
+2 −0
Challenges Repeat the characters

JavaScript, 36 bytes s=>n=>s.replace(/./g,`$&`.repeat(n)) Try it online!

posted 2y ago by Shaggy‭

Answer
66%
+2 −0
Challenges Repeat the characters

Japt -m, 2 bytes pV Try it pV :Implicit map of first input string p :Repeat V :Second input times

posted 2y ago by Shaggy‭  ·  edited 2y ago by Shaggy‭

Answer
80%
+6 −0
Challenges Digit Sum Integer Sequence (working title)

Inspired by this challenge. If anyone has any suggestions for a song title I could use for the challenge title then please leave a comment. Definition We define f(x) for a given integer as the su...

6 answers  ·  posted 2y ago by Shaggy‭  ·  last activity 7mo ago by RubenVerg‭

Question code-golf sequence
66%
+2 −0
Challenges "Hello, {name}!"

Japt, 10 bytes `HÁM, {U}! Try it The backtick decompresses a compressed string, the {} is Japt's string interpolation and U is the first input variable.

posted 2y ago by Shaggy‭  ·  edited 2y ago by Shaggy‭

Answer
60%
+1 −0
Challenges Stairs? Stairs! Stairs.

Japt -R, 13 bytes Uses = in place of #. Æ"_/"+Xç¥ÃoÅù Try it Æ"_/"+Xç¥ÃoÅù :Implicit input of integer U Æ :Map each X in the range [0,U) "_/" : Literal str...

posted 2y ago by Shaggy‭  ·  edited 2y ago by Shaggy‭

Answer
60%
+1 −0
Challenges 1, 2, Fizz, 4, Buzz!

Rockstar, 138 135 133 bytes F takes I&S let M be N/I turn up M if N-I*M S's"" return S N's0 while N-100 let N be+1 say F taking 3,"Fizz"+F taking 5,"Buzz" or N Try it here (Cod...

posted 2y ago by Shaggy‭  ·  edited 2y ago by Shaggy‭

Answer
66%
+2 −0
Challenges Word Set Square

JavaScript, 76 bytes Outputs an array of lines. s=>[...s+=[...s].reverse().join``].map((c,x)=>s[-~x]?c.padEnd(x)+(x?c:``):s) Try it online!

posted 2y ago by Shaggy‭

Answer
60%
+1 −0
Challenges Generalized Sort

Japt -h, 5 bytes Takes the array to be sorted as input and assigns the array of functions, in reverse order, to variable V. V£=ñX Try the names test case I could save a byte by replacing =ñ w...

posted 2y ago by Shaggy‭  ·  edited 2y ago by Shaggy‭

Answer
60%
+1 −0
Challenges Generalized Sort

JavaScript, 25 bytes Arguments are curried, i.e. f(a)(s), where a is the array to be sorted and s is an array of functions to sort by, in reverse order. Modifies a in place, which I don't know tha...

posted 2y ago by Shaggy‭  ·  last activity 2y ago by Shaggy‭

Answer
60%
+1 −0
Challenges Make my value binary

JavaScript, 16 bytes n=>n.toString(2) Try it online!

posted 2y ago by Shaggy‭

Answer
60%
+1 −0
Challenges Make my value binary

Japt, 1 byte ¤ Try it or run all test cases

posted 2y ago by Shaggy‭

Answer
60%
+1 −0
Challenges My house is destroyed! Can you make me one?

Rockstar, 82 bytes listen to N let N be-2 X's-1 say "##"+"#"*N while N-X say "#"+" "*N+"#" let X be+1 Try it (code will need to be pasted in)

posted 2y ago by Shaggy‭

Answer
60%
+1 −0
Challenges Make $2 + 2 = 5$

JavaScript, 19 bytes x=>y=>x-2|y-2?x+y:5 Try it online!

posted 2y ago by Shaggy‭

Answer
71%
+3 −0
Challenges Make $2 + 2 = 5$

Japt -x, 6 5 bytes Takes input as an array of integers p!UdÍ Try it p!UdÍ :Implicit input of array U p :Push ! : Logical NOT of Ud : Any true (not zero) when ...

posted 2y ago by Shaggy‭  ·  edited 2y ago by Shaggy‭

Answer
60%
+1 −0
Challenges My house is destroyed! Can you make me one?

JavaScript, 47 bytes n=>`0`.repeat(n)+(` 0`.padEnd(n--)+0).repeat(n) Try it online! My first pass used recursion before I realised I was over thinking things! First 51 byte version inclu...

posted 2y ago by Shaggy‭  ·  edited 2y ago by Shaggy‭

Answer
60%
+1 −0
Challenges My house is destroyed! Can you make me one?

Japt -R, 11 10 bytes ÆQ+ùUÉÃvçQ Try it ÆQ+ùUÉÃvçQ :Implicit input of integer U Æ :Map the range [0,U) Q : Quotation mark + : Append another ...

posted 2y ago by Shaggy‭  ·  edited 2y ago by Shaggy‭

Answer
60%
+1 −0
Challenges Roll n fair dice

Japt -mx, 3 bytes Takes n as the first input and m as the second. ÒVö Try it ÒVö :Implicit map of the range [0,first input) Ò :Negate the bitwise NOT of (i.e., increment) V ...

posted 2y ago by Shaggy‭  ·  edited 2y ago by Shaggy‭

Answer
81%
+7 −0
Challenges In The Jailhouse Now

Challenge Given an integer n>=4 as input create an ASCII art "prison door"* measuring n-1 characters wide and n characters high, using the symbols from the example below. Example ╔╦╗ ╠╬╣ ...

6 answers  ·  posted 2y ago by Shaggy‭  ·  last activity 2y ago by snail_‭

Question code-golf ascii-art
66%
+2 −0
Challenges Multiply two strings

JavaScript, 37 bytes I/O as character arrays. a=>b=>b.flatMap(x=>a.map(y=>x<y?x:y)) Try it online!

posted 2y ago by Shaggy‭

Answer