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
1.5k posts
 
71%
+3 −0
Challenges Multiply two strings

Jelly, 2 bytes «þ Try it online! Technically speaking, this needs to be a full program, due to how Jelly's smash printing works, but it can get away with being run as a function over test case...

posted 2y ago by caird coinheringaahing‭  ·  edited 2y ago by caird coinheringaahing‭

Answer
71%
+3 −0
Challenges Multiply two strings

BQN, 3 bytes Anonymous tacit infix function, taking the second string as left argument and the first string as right argument. ⥊⌊⌜ ⌊⌜ minimum table ⥊ deshape (flatten) BQN treats characters ...

posted 2y ago by Adám‭  ·  edited 2y ago by Adám‭

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

Background A House of I I went on an adventure Grabbed resources and making deeds Like start to work on the materials To build the shelter I need It was a marvelous one At least in the eyes ...

10 answers  ·  posted 2y ago by General Sebast1an‭  ·  last activity 2y ago by Quintec‭

Question code-golf string
71%
+3 −0
Challenges Roll n fair dice

Ruby, 28 bytes ->n,m{(1..n).sum{rand(m)+1}} Try it online!

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

Answer
71%
+3 −0
Challenges Make $2 + 2 = 5$

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 ...

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

Answer
71%
+3 −0
Challenges Make $2 + 2 = 5$

Zsh, 25 bytes >2 <$@&&<<<5||<<<$[$1+$2] Attempt This Online! Explanation: >2;<$@: if both arguments are 2: &&<<<5: then print 5 ||&...

posted 2y ago by pxeger‭

Answer
71%
+3 −0
Challenges Make $2 + 2 = 5$

Python 3, 24 bytes lambda x,y:x+y+(x==y==2) Try it online!

posted 2y ago by bastolski‭

Answer
71%
+3 −0
Challenges Compute the determinant

Python 3.8 (pre-release), 106 95 bytes Saved 11 bytes thanks to Peter Taylor! f=lambda m:sum((-1)**i*x*f([r[:i]+r[i+1:]for r in m[1:]])for i,x in enumerate(m[0]))if m else 1 Try it online! ...

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

Answer
71%
+3 −0
Sandbox Balance my ternary[FINALIZED]

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

71%
+3 −0
Challenges Generalized Sort

Challenge We all know and love the generic sort function, right? However, it only sorts based off one criterion - what if we want more? That's where you come in. Your task is to sort an array bas...

6 answers  ·  posted 2y ago by Moshi‭  ·  last activity 2y ago by radarek‭

Question code-golf sorting
71%
+3 −0
Challenges Make my value binary

Ahead, 20 bytes I>:2%r vn:/2\< >}KO@ Control flow goes like this: # orange path: init I # read number # green path: main loop > # go east (start of loop) : # dup inpu...

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

Answer
71%
+3 −0
Meta Separate the tags away from the Sandbox or delete the [finalized] tag

This is a feature-request post consisting of 2 actions for a reason... There's this thing that's been bugging me for a while in Code Golf CD. If you go to the tag page of the Challenges catego...

0 answers  ·  posted 2y ago by General Sebast1an‭  ·  edited 2y ago by General Sebast1an‭

71%
+3 −0
Challenges "Hello, {name}!"

Bash, 20 18 bytes Saved two bytes by removing the quotes; the code works well without them. echo Hello, `cat`! Try it online!

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

Answer
71%
+3 −0
Q&A Tips for golfing in Python

If you print some string s without a newline character at the end, instead of print(s,end="") write print(end=s) to save two bytes. Note that this only works for strings, not for other typ...

posted 2y ago by celtschk‭  ·  edited 2y ago by General Sebast1an‭

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

JavaScript (Node.js), 47 40 50 49 bytes -1 (possibly -3) bytes thanks to Shaggy! f=(n,s='0')=>n?f(n/3+n%3/2|0,'')+"+-0+-"[n%3+2]:s Try it online! A basic recursive solution.

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

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 2y ago by Hakerh400‭  ·  edited 2y ago by Hakerh400‭

Answer
71%
+3 −0
Challenges Stairs? Stairs! Stairs.

Python 3, 64 bytes def f(n): for i in range(n):print((' '*(n-i)+'_/'+'##'*i)[3:]) Try it online!

posted 2y ago by Moshi‭

Answer
71%
+3 −0
Meta Add detailed wikis and usage info on these tags

In this request (not really a feature-request but still tagged so anyway), I'd like to have detailed wikis on tags and maybe usage information on them too. Currently, these tags have usage info in...

1 answer  ·  posted 3y ago by General Sebast1an‭  ·  last activity 3y ago by General Sebast1an‭

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

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...

posted 3y ago by Shaggy‭

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

Python 3, 20 bytes lambda l:len({*l})<2 Try it online!

posted 3y ago by m90‭

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 Generate Lewis Caroll's Jabberwocky

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Ø ...

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

Answer
71%
+3 −0
Challenges Reduce over the range [1..n]

Ruby, 17 bytes ->{_2.reduce(_1)} Takes function (Proc) followed by Array. 32 bytes without inject or reduce ->f,(a,*r){r.map{|n|a=f[a,n]};a}

posted 3y ago by Wezl‭

Answer
71%
+3 −0
Challenges Reduce over the range [1..n]

Haskell, 18 bytes n!g=foldl1 g[1..n] Try it online!

posted 3y ago by Hakerh400‭

Answer
71%
+3 −0
Sandbox 12-hour time is weird [finalized]

posted 2mo ago by honnza‭  ·  edited 2mo ago by honnza‭