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‭

123 posts
66%
+2 −0
Challenges 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!

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

Answer
66%
+2 −0
Challenges Borromean coprimes

Japt v1.4.5 -!, 8 bytes à ËryÃa1 Try it or run all test cases à ËryÃa1 :Implicit input of array à :Combinations (with the original array first) Ë :Map r ...

posted 3mo ago by Shaggy‭

Answer
66%
+2 −0
Challenges Find all unique quintuplets in an array that sum to a given target

Japt, 12 bytes Outputs an empty array if no solution is possible. Íà5 â fÈx ¶V Try it Íà5 â fÈx ¶V :Implicit input of array U & target integer V Í :Sort U à5 ...

posted 4mo ago by Shaggy‭

Answer
66%
+2 −0
Challenges Source with the whole alphabet in order of appearance

Japt, 26 bytes aBcDeFgHiJkLmNoPqRsTuVwXyZ Try it Trivial Solution, 26 bytes ABCDEFGHIJKLMNOPQRSTUVWXYZ Try it Explanations In the first solution each lowercase letter is a method that ge...

posted 6mo ago by Shaggy‭  ·  edited 6mo ago by Shaggy‭

Answer
66%
+2 −0
Q&A Up to date JavaScript Try-It-Online

There is a new project called Attempt This Online intended as an alternative to TIO. It's pretty nascent so doesn't yet support the same volume of languages as TIO and the only version of JavaScrip...

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

Answer
66%
+2 −0
Challenges 8 coexisting queens

Japt -R, 16 15 bytes Uses spaces for #s and "s for Qs. ##Ë64ì £QùXÄÃy Test it (footer reformats the output to use the characters from the spec) This one uses 1s for #s. ##Ë64ì £#ÿ¤hXQ ...

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

Answer
66%
+2 −0
Challenges Presumptuous base conversion

Japt, 13 bytes Takes input as a character array. mnG ìUrÔÄ ªUl Try it mnG\nìUrÔÄ ªUl :Implicit input of character array U m :Map n : Convert from bas...

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

Answer
66%
+2 −0
Challenges "Hello, {name}!"

JavaScript, 28 bytes alert(`Hello, ${prompt()}!`) Try it online!

posted 3y 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 3y ago by Shaggy‭

Answer
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 3y ago by Shaggy‭

Answer
66%
+2 −0
Challenges Multiply two strings

Japt -m, 5 bytes Takes input in reverse order. Sadly, Japt has no minimum built-in for strings. VcmUc Try it VcmUc :Implicit map of each U in the first input string V :Second inp...

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

Answer
66%
+2 −0
Challenges 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 n**3 then ... Japt, 14 bytes NcU³Æ=Âp½+UuÃâ ...

posted 3y ago by Shaggy‭

Answer
66%
+2 −0
Challenges 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!

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

Answer
66%
+2 −0
Challenges Tile pyramids on top of each other!

Japt -R, 12 bytes õÈ"/\\"mpXÃû Try it õÈ"/\\"mpXÃû :Implicit input of integer õ :Range [1,input] È :Map each X "/\\" : Literal string m ...

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

Answer
66%
+2 −0
Challenges 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!

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

Answer
66%
+2 −0
Challenges 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 the...

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

Answer
66%
+2 −0
Challenges Guess the language! (Cops' Thread)

Rockstar, cracked by Hakerh400, 126 bytes I never thought of languages that would ignore everything except the strings - I should have stated that the solution should be irreducible. Hakerh400 get...

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

Answer
66%
+2 −0
Challenges Guess the language! (Robbers' Thread)

Cracks Mark Girrafe's answer: Rust fn main(){print!("Cops and Robbers")} Try it online!

posted 3y ago by Shaggy‭

Answer
66%
+2 −0
Challenges Guess the language! (Cops' Thread)

Japt, cracked by Razetime, 44 bytes ((Cops)&(Robbers))`¬ps „d žbÞ`¸ËhDÎmEgviuø Test it `...`¸ËhDÎmEgviuø `...` :Compressed string "cops and robbers" ¸ ...

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

Answer
66%
+2 −0
Challenges Golf a FRACTRAN interpreter

JavaScript, 44 bytes a=>g=n=>a.every(([p,q])=>(x=n*p/q)%1)?n:g(x) Try it online!

posted 4y ago by Shaggy‭

Answer
66%
+2 −0
Challenges Golf a FRACTRAN interpreter

Japt v2.0a0, 18 bytes The r÷ can be removed if we can take an array of floats instead. T=V£*Xr÷Ãæv1)?ßT:U Try it T=V£*Xr÷Ãæv1)?ßT:U :Implicit input of integer U and 2D-array V T= ...

posted 4y ago by Shaggy‭  ·  edited 3y ago by Shaggy‭

Answer
66%
+2 −0
Challenges Diagonalized alphabet

Japt -R, 16 bytes This feels far too long for the task at hand - what am I missing?! ;Bó v ¬£14îUiX q Test it ;Bó\nv ¬£14îUiX q ;B :Uppercase alphabet ó ...

posted 4y ago by Shaggy‭  ·  edited 3y ago by Shaggy‭

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

Japt -R, 27 bytes Lõ@"FiBu"ò úz4 ËpXv°EÑÄìªX Test it Lõ@"FiBu"ò úz4 ËpXv°EÑÄìªX L :100 õ :Range [1,L] @ ...

posted 4y ago by Shaggy‭

Answer
66%
+2 −0
Challenges Merge two strings

Japt -h, 13 12 9 bytes à m+V kbU Try it à m+V kbU :Implicit input of strings U & V à :Combinations of U m :Map +V : Append V k :Filt...

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

Answer
66%
+2 −0
Challenges Truthify an array

Japt -m, 8 7 bytes ð òÎmiV Try it ð òÎmiV :Implicit map of each sub-array at 0-based index V ð :Indices of truthy (i.e., non-zero) elements ò :Partition between eleme...

posted 4y ago by Shaggy‭  ·  edited 3y ago by Shaggy‭

Answer