Posts by Shaggy
Challenge A catalogue type challenge that simply asks: Given an integer n (where n>=0) as input return a truthy value if n is a perfect square or a falsey value if not. Rules You may take...
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 Outpu...
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 ╔╦╗ ╠╬╣ ...
Japt, 11 10 bytes >0©ÒßUÉ/°T Try it >0©ÒßUÉ/°T :Implicit input of integer U >0 :Greater than 0? © :Logical AND with Ò :Negate the bitwise ...
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...
Japt, 27 Solutions This started out as a collaboration with Quintec but quickly got very out of hand! Posted with their permission. More solutions to follow. Hopefully! 256 Try it Just the b...
Japt -x, 6 5 bytes Ë*VpE Try it Ë*VpE :Implicit input of array U and float V Ë :Map each element D at 0-based index E * : Multiply D by VpE : V raised to the pow...
JavaScript, 28 bytes f=n=>n-1&&-~f(n%2?n*3+1:n/2) Try it online!
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
JavaScript (V8), 44 bytes a=>a.map((a,x)=>a.map((n,y)=>n&&print(x,y))) Try it online!
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...
Japt -h, 19 18 bytes Gõ ñ@ìX xg#5#}4s3 Try it Gõ ñ@ìX xg#5#}4s3 :Implicit input of integer U G :16 õ :Range [1,G] ñ :Sor...
Python, 45 bytes I am not a Python guy at all, so I'm quite proud of this. I'm sure, though, there's something simple I could be doing to save myself a few bytes! lambda n:int(n,int(max("1"+n),...
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 ...
Japt -N, 9 bytes ¨T©ÒßVVnU Try it ¨T©ÒßVVnU :Implicit input of integers U & V ¨ :U is >= T : 0 © :Logical AND with Ò :Negate the...
Japt, 610 606 bytes Don't think there's anything more that can be done with it than this. 933î`'T°s ߦg, d e sÒy v Did gy d g½e e °¼; A¥ Úßy ØÀ e Þgov, A e Ú ÎÈs tg¼.0"BeØ ...
Japt -R, 16 15 14 bytes pÔ¬Ëú°EDùEÃÆpÔ Try it pÔ¬Ëú°EDùEÃÆpÔ :Implicit input of string p :Append Ô : Reverse ¬ :Split Ë ...
Japt, 4 bytes P1 is: +"+U Try it Which outputs P2, where N1 is the input from P1: N1+U Try it
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!
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...
JSFuck, cracked by user*, 6106 bytes *With honourable mention to AndrewTheCodeGolfer who first recognised it as JavaScript. This version will only work in Firefox v90+. [][(![]+[])[+!![]]+(!![]+...
Cracks Mark Girrafe's answer: Rust fn main(){print!("Cops and Robbers")} Try it online!
Cracks Mark Girrafe's answer: F# printfn"Cops and Robbers" Try it online!
Cracks Quintec's answer: Canvas My first clue was the echp; if the language used echo then why wouldn't it error on that? The second clue was that the last line contained the exact output we need...