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...
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
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),...
JavaScript, 28 bytes f=n=>n-1&&-~f(n%2?n*3+1:n/2) Try it online!
JavaScript (V8), 44 bytes a=>a.map((a,x)=>a.map((n,y)=>n&&print(x,y))) Try it online!
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, 18 bytes "[{/V*50 ç| ú-50}] Try it
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...
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.
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Ø ...
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, 4 bytes P1 is: +"+U Try it Which outputs P2, where N1 is the input from P1: N1+U Try it
JavaScript, 28 bytes alert(`Hello, ${prompt()}!`) Try it online!
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...
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!
JavaScript (Node.js), 33 bytes a=>n=>a.reduce((o,x,y)=>o+x*n**y) Try it online!
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 ...