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 »

Search

Advanced Search Options

To further refine your search, you can use additional qualifiers such as score:>0.5. For example, the search score:>=0.5 created:<1y grammar would return only posts mentioning "grammar" that have a score >= 0.5 and were created less than a year ago.

Further help with searching is available in the help center.

Quick hints: tag:tagname, user:xxx, "exact phrase", post_type:xxx, created:<N{d,w,mo,y}, score:>=0.5

Filters
 
60%
+1 −0
Challenges Generalized Sort

JavaScript (Node.js), 52 bytes (A,...c)=>A.sort((a,b)=>c.map(z=>z(a,b)).find(x=>x)) Try it online! A golf of the reference code. If we can assume there will be no ties, 47 is po...

posted 4y ago by emanresu A‭

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

Ruby, 11 bytes ->n{"%b"%n} Simple string formatting. Try it online!

posted 4y ago by snail_‭

Answer
60%
+1 −0
Challenges Generalized Sort

Haskell, 29 bytes import Data.List foldr sortBy Try it online!

posted 4y ago by Hakerh400‭

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 4y ago by Shaggy‭  ·  last activity 4y 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 4y ago by Shaggy‭  ·  edited 4y 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 4y ago by Shaggy‭  ·  edited 4y ago by Shaggy‭

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

Julia 1.0, 9 bytes bitstring Try it online! Lots of leading zeros, but those are allowed (just not necessary)!

posted 4y ago by digital_carver‭

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

Julia 1.0, 79 bytes println.(i%15<1 ? "FizzBuzz" : i%3<1 ? "Fizz" : i%5<1 ? "Buzz" : i for i=1:100) Try it online!

posted 4y ago by digital_carver‭

Answer
60%
+4 −2
Challenges "Hello, {name}!"

Background While we do have a "Hello, World!" challenge, we still don't have one regarding input. So let's do one! Challenge Create a program that takes an input (not as a function argument) the...

17 answers  ·  posted 4y ago by General Sebast1an‭  ·  last activity 2mo ago by CrSb0001‭

Question code-golf string
60%
+1 −0
Challenges "Hello, {name}!"

Python 3, 27 bytes print(f"Hello, {input()}!") Try it online!

posted 4y ago by General Sebast1an‭

Answer
60%
+1 −0
Challenges "Hello, {name}!"

Lua, 35 32 bytes print("Hello, "..io.read().."!") Try it online! Golfed 3 bytes thanks to @Moshi's advice.

posted 4y ago by General Sebast1an‭  ·  edited 4y ago by General Sebast1an‭

Answer
60%
+1 −0
Challenges "Hello, {name}!"

Sclipting, (UTF-16) 14 bytes 낆녬닆묬글⑴긐

posted 4y ago by Moshi‭

Answer
60%
+1 −0
Challenges "Hello, {name}!"

Ruby, 24 21 18 bytes p"Hello, #{gets}!" Try it online! Golfed down 3 bytes thanks to @snail_'s advice. Golfed down 3 bytes thanks to @south's advice.

posted 4y ago by General Sebast1an‭  ·  edited 3y ago by General Sebast1an‭

Answer
60%
+1 −0
Challenges Golf a FRACTRAN interpreter

Ruby, 51 50 bytes -1 from Razetime ->p,n{while i=p.find{(_1*n).to_f%1==0} n*=i end n} Try it online!

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

Answer
60%
+1 −0
Q&A Tips for golfing in Ruby

Omitting parens on function calls You can omit parentheses on function calls in many cases. foo(bar,baz) foo bar,baz This is even true if a function call doesn't have any parameters. (This is...

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

Answer
60%
+1 −0
Challenges Word Set Square

Python 3, 196 195 145 102 91 89 87 79 bytes x=input();x+=x[::-1];i=-1 for c in x[:-1]:print(c*(i>-1)+" "*i+c);i+=1 print(x) Try it online! Golfed 50 bytes thanks to @celtschk's advice. ...

posted 4y ago by General Sebast1an‭  ·  edited 4y ago by General Sebast1an‭

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

Lua, 126 118 bytes p=print for i=1,100 do if i%15==0 then p"FizzBuzz"elseif i%3==0 then p"Fizz"elseif i%5==0 then p"Buzz"else p(i)end end Try it online!

posted 4y ago by General Sebast1an‭  ·  edited 3y ago by General Sebast1an‭

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

C (gcc), 87 bytes P1: i;main(){scanf("%d",&i);printf("i;main(){scanf(\"%%d\",&i);printf(\"%%d\",%d+i);}",i);} Try it online! Generated P2 for input 10: i;main(){scanf("%d",&i...

posted 4y ago by celtschk‭

Answer
60%
+1 −0
Challenges Coat of Many Colours

Python 3, 349 261 160 bytes a="re y gree br sc bla oc pe rub ol v f li go ch m cre cri si ro a le rus grey pu w pi or blu".split() def f(b):return[j for i in a for j in b if j[:len(i)]==i] T...

posted 4y ago by General Sebast1an‭  ·  edited 3y ago by General Sebast1an‭

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

Charcoal, 7 bytes GH↑→↓N# Try it online! Link is to verbose version of code. PolygonHollow exactly fits this challenge. Prints a polygon with sides in x, all with length y, and the z used ...

posted 4y ago by Razetime‭

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

Challenge Make a program that takes input of an integer that's $n > 1$ and print out a staircase using a specific character for stair basing (hashes (#) for demonstration; you can use spaces,...

7 answers  ·  posted 4y ago by General Sebast1an‭  ·  last activity 3y ago by radarek‭

Question code-golf ascii-art string
60%
+1 −0
Q&A Tips for golfing in Python

Use lambdas instead of functions At most times, lambdas tend to make smaller code, which is helpful in golfing. Assigning a lambda is easy, just do: lambda f:whatever There are many answers th...

posted 4y ago by General Sebast1an‭

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

Ahead, 10 bytes IO"@O+I"W@ This prints N1I+0@. Try it online!

posted 4y ago by snail_‭

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 4y ago by Shaggy‭  ·  edited 4y ago by Shaggy‭

Answer