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 Hakerh400‭

59 posts
86%
+11 −0
Challenges Output 256 in many different ways

JavaScript, 11 solutions !``<<!``<<!``<<!``<<!``<<!``<<!``<<!``<<!`` TIO 2**2**2*2**2**2 TIO 55555555555555555555555555555555555555555555555...

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

Answer
81%
+7 −0
Challenges Truthify an array

JavaScript (Node.js), 74 70 bytes Works for any number of dimensions. f=(a,z=[])=>a.map?.((b,c)=>z.push(...f(b).map(a=>[c,...a])))?z:a?[z]:z Try it online! (TIO uses an old version ...

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

Answer
80%
+6 −0
Challenges Reverse an ASCII string

JavaScript, 25 24 bytes -1 byte thanks to @Arnauld‭ f=([a,...b])=>a?f(b)+a:b Try it online!

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

Answer
77%
+5 −0
Challenges Print the Great Numeric Pyramid

JavaScript (Node.js), 137 136 117 bytes with(Math)f=n=>(m=(a,b)=>a?m(--a,b)+b(a):[])(28,y=>m(55,x=>x>26-y&x<y+28&(x^y)?min(abs(abs(27-x)-y)/2,27-y):' ')+` `) Try it...

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

Answer
77%
+5 −0
Challenges Guess the language! (Robbers' Thread)

Cracks Shaggy‭'s answer Let the cops be "Cops" The conjunction is " and " The robbers are "Robbers" Say the cops with the conjunction with the robbers It can be one of: FALSE Phooe...

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

Answer
77%
+5 −0
Challenges Given the preorder and the inorder of a tree, output the postorder

Definitions A binary tree is either a null (leaf), or an object (node). A node contains a value (non-negative integer) and two pointers (left and right) to two separate binary trees. A binary tre...

2 answers  ·  posted 4y ago by Hakerh400‭  ·  last activity 3y ago by radarek‭

Question code-golf
77%
+5 −0
Challenges Integer to Roman numeral

JavaScript (Node.js), 147 bytes f=(a,b='IVXLCDM',g=Math.log10(a)<<1,c=10**(g/2),e=a/c|0,i=b[g+1],j=a=>b[g].repeat(a))=>a?(e<4?j(e):e<6?j(5-e)+i:e<9?i+j(e-5):j(1)+b[g+2])+f(a...

posted 4y ago by Hakerh400‭

Answer
77%
+5 −0
Challenges Longest parallel lines

JavaScript (Node.js), 541 540 bytes for(_='=>)==!(+==0h,.map(M,R(=1,,e,b &&Nl=[-1,))s(n,=(a a=u,v(i=g(z,u,f=(a,w,cs=Math.max,r?[...r(--a ) (a)]:[],R>&b>&a<w&b<...

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

Answer
77%
+5 −0
Challenges "Hello, World!"

Common Lisp, 26 22 bytes (princ"Hello, World!") -4 bytes thanks to @Sisyphus‭ Try it online!

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

Answer
75%
+4 −0
Challenges Evaluate a single variable polynomial equation

JavaScript (Node.js), 40 bytes f=(a,b,c=1)=>a.reduce((d,e)=>d+e*(c*=b)) Try it online!

posted 4y ago by Hakerh400‭

Answer
75%
+4 −0
Challenges It's Hip to be Square

Haskell, 24 bytes Probably the optimal solution. Credits go to nimi from PPCG. f n=elem n$map(^2)[0..n] Try it online! My original solution, 25 bytes f a=any((==a).(^2))[0..a] Try it ...

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

Answer
75%
+4 −0
Challenges Is it a near-anagram?

JavaScript (Node.js), 150 71 bytes f=(a,b)=>a[b.length]?f(b,a):b.filter(x=>a[y=a.indexOf(x)]=!~y).length-1 Try it online!

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

Answer
75%
+4 −0
Challenges Create an Alphabet Diamond

JavaScript (Node.js), 78 bytes (m=(a,b=26,c=a(--b))=>b?[c,...m(a,b),c]:[c])=>m(a=>m(b=>(c=25-a-b)<0?32:c+65)) Try it online!

posted 4y ago by Hakerh400‭

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

JavaScript (Node.js), 64 bytes for(n=0;101>++n;)console.log([['Fizz'][n%3]]+[['Buzz'][n%5]]||n) Try it online!

posted 4y ago by Hakerh400‭

Answer
71%
+3 −0
Challenges Find good coalitions

Haskell, 141 bytes import Control.Monad f a=map(map fst)$filter(\c->let{g=map snd;e=sum(g a)`div`2;f=g c;d=sum f}in d>e&&all((<=e).(d-))f)$filterM(pure[1<0..])a Try it ...

posted 3y ago by Hakerh400‭

Answer
71%
+3 −0
Challenges Reverse your quine

JavaScript (Node.js), 60 bytes f=a=>console.log(`)(f;${[...f+``].reverse``.join``}=f`);f() Try it online!

posted 3y ago by Hakerh400‭

Answer
71%
+3 −0
Challenges Reverse your quine

Haskell, 78 bytes main=putStr$reverse$a++show a where a="main=putStr$reverse$a++show a where a=" Try it online!

posted 3y ago by Hakerh400‭

Answer
71%
+3 −0
Challenges The Ludic Numbers

Haskell, 51 49 bytes -2 bytes thanks to Wheat Wizard 1:g[2..] g(a:b)=a:g[d|(c,d)<-zip[1..]b,c`mod`a>0] Try it online!

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

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

Haskell, 43 39 bytes f 1=0 f n=1+f([div n 2,n*3+1]!!mod n 2) Try it online!

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

Answer
71%
+3 −0
Challenges Abbreviate everything

Haskell, 139 138 bytes import Data.Char f(a:b)|d a=toUpper a:f(dropWhile(\a->e a"-'"||d a)b)|e a":;"=a:c|e a".?!"=' ':c|0<1=c where c=f b;d=isLetter;e=elem f a=a Try it online!

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

Answer
71%
+3 −0
Challenges Repeat the characters

Haskell, 18 bytes (.replicate).(>>=) Try it online!

posted 3y ago by Hakerh400‭

Answer
71%
+3 −0
Challenges Digit Sum Integer Sequence (working title)

Haskell, 56 bytes f a=a:f(a+g(read.pure<$>show a)) g a=minimum a+maximum a Try it online!

posted 3y ago by Hakerh400‭

Answer
71%
+3 −0
Challenges When The Ternary Is Balance

Haskell, 78 77 bytes (g[0]!) g a=mapM(\_->[-1..1])a++g(0:a) (a:b)!c|foldl1((+).(*3))a==c=a|0<1=b!c Try it online!

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

Answer
71%
+3 −0
Challenges Are All Elements Equal?

Haskell, 16 bytes f(a:b)=all(==a)b Try it online!

posted 3y ago by Hakerh400‭

Answer
71%
+3 −0
Challenges Word Set Square

Haskell, 110 bytes f a=s>>=(#)$a++reverse a c@(a:b)!f=f c:b!f _!_=[] f#n=n!((n!).f) s(p:q)(d:e)(b:c)|e==c||e==[]=b|q==c=d|0<1=' ' Try it online!

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

Answer