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
 
66%
+2 −0
Meta How should we handle incorrect answers?

^ That can be used. You can try to contact the person who posted the challenge and have them mark the answer as "React -> Invalid". Or otherwise it seems that anyone can mark an answer as inva...

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

Answer
66%
+2 −0
Challenges Sort letters by height

Japt, 23 16 15 13 bytes Lexicographical sort using the custom alphabet tipbdghkflyqj. I/O as characters arrays, sorts in ascending order. n`“pbdghkf§qj Try it

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

Answer
66%
+2 −0
Challenges Sort letters by height

Python 3, 43 bytes lambda x:sorted(x,key='tibdfghklpqyj'.find) Try it online! Sorts based on index in a sorted string. Inputs as a string and outputs as a list. -14 bytes by replacing .inde...

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

Answer
66%
+2 −0
Challenges Digit antitranspose

Convert a matrix or grid of digits to its antitranspose. For a square matrix , this is its reflection in its antidiagonal. More generally, for a rectangular matrix, this is its reflection in its sk...

4 answers  ·  posted 2y ago by trichoplax‭  ·  last activity 2y ago by torres‭

Question code-golf number
64%
+7 −3
Challenges Make $2 + 2 = 5$

In this challenge, add 2 integers, but if both the integers are 2, output 5. Shortest code in each language wins! Example ungolfed program in Python 3.x def add(x, y): if x == 2 and y == 2: ...

23 answers  ·  posted 3y ago by General Sebast1an‭  ·  last activity 5mo ago by arutonee‭

Question code-golf math number
62%
+3 −1
Meta Under which condition is a function that takes arguments other than those specified by the challenge by itself a valid solution to a challenge?

On my challenge Looping Counter there are several entries like this which contains a function which needs to be called with the right parameters to give the correct output. In this particular case,...

1 answer  ·  posted 3y ago by celtschk‭  ·  last activity 3y ago by Quintec‭

Question discussion rules
62%
+3 −1
Meta Under which condition is a function that takes arguments other than those specified by the challenge by itself a valid solution to a challenge?

What you said a function is a valid solution to a challenge if and only if it can be called with no more than the specified input of the task This sounds reasonable to me. If you want to make...

posted 3y ago by Quintec‭

Answer
62%
+3 −1
Challenges Print the modular multiplicative inverse / virtual fractions

Goal Print the modular multiplicative inverse with a modulus of 65536 (or a higher exponent of 2) for odd numbers 1-97. Example output Print these values (or an extension of them): 1 43691 52...

2 answers  ·  posted 1y ago by H_H‭  ·  last activity 17d ago by CrSb0001‭

Question code-golf math
60%
+1 −0
Challenges Plain black webpage

HTML, 31 Bytes <HTML style="background:black"> The best solution is frequently the easiest one.

posted 1y ago by ATaco‭  ·  edited 1y ago by ATaco‭

Answer
60%
+1 −0
Challenges Shortest representation in generalised Roman numerals

Jelly, 45 bytes L‘ḃ5MḢ;‘$œṖƲḅ5aị¥⁸N1¦Sṭ “¢¦½2d‘Çȷ6¡iḃ5ị“IVXLC Try it online! A pair of links that takes an integer as its argument and returns a string with the shortest generalised Roman num...

posted 1y ago by NikNakk‭  ·  edited 1y ago by NikNakk‭

Answer
60%
+1 −0
Challenges Shortest representation in generalised Roman numerals

Find the shortest representation of an integer in generalised Roman numerals. Since there is more than one way to generalise, only the following definition applies to this challenge. Definition T...

1 answer  ·  posted 1y ago by trichoplax‭  ·  last activity 1y ago by NikNakk‭

Question code-golf number
60%
+1 −0
Challenges Single digit Roman numeral

Haskell, 62 bytes (\n->(scanl(*)1$cycle[5,2])!!(length$takeWhile(/=n)"IVXLCDM")) No import needed. It just uses standard Prelude functions. scanl(*)1$cycle[5,2] will give you the infinit...

posted 1y ago by Arpad Horvath‭  ·  edited 1y ago by Arpad Horvath‭

Answer
60%
+1 −0
Challenges Single digit Roman numeral

Swift, 114 bytes func y(x:String)->Int?{return ["I":1,"V":5,"X":10,"L":50,"C":100,"D":500,"M":1000].filter{$0.key==x}.first?.value} Try it online! Explanation + Non-Golfed Version The no...

posted 1y ago by MrDevel0per‭  ·  edited 1y ago by trichoplax‭

Answer
60%
+1 −0
Challenges Fibonacci without consecutive digits

Python 3, 149 bytes g=lambda r:r>1and g(r-1)+g(r-2)or r lambda n:[i for(i)in map(g,range(2*n+2))if(lambda*l:all(abs(n-i)!=1for(n,i)in zip(l,l[1:])))(*map(int,str(i)))][n] Try it online! ...

posted 1y ago by ok12d‭  ·  edited 1y ago by ok12d‭

Answer
60%
+1 −0
Challenges Plain black webpage

HTML, 25 bytes <style>*{background:#000} Not really sure if this is a legal solution, but technically you can open it in your browser...

posted 1y ago by Moshi‭

Answer
60%
+1 −0
Challenges Make $2 + 2 = 5$

ESCR - not a golfing answer This isn't really an answer to the question, and it's not an attempt at golfing. However, it shows a cute trick for solving this problem that falls out of the way the ...

posted 1y ago by Olin Lathrop‭  ·  edited 1y ago by Olin Lathrop‭

Answer
60%
+1 −0
Challenges Is it stuck in a counting loop?

Pyth, 8 bytes qu/Red._ Try it online! A list is in a loop if and only if it is the first list seen twice as f is applied repeatedly. qu/Red._ u Apply the following function, ...

posted 1y ago by isaacg‭

Answer
60%
+1 −0
Challenges Can I follow this recipe?

Pyth, 15 bytes !f.A-VtTsM._T.p Try it online! Outputs True if no valid recipe exists, False if one does. If truthy/falsy outputs are allowed, the ! can be removed, to just output all valid per...

posted 1y ago by isaacg‭

Answer
60%
+1 −0
Challenges Plain black webpage

HTML, 28 Bytes <HTML style=background:#000> #000 is shorter than black and quote marks are officially required but browsers figure it out.

posted 1y ago by manassehkatz‭

Answer
60%
+1 −0
Challenges Fibonacci without consecutive digits

Pyth, 25 23 bytes @f-1aM.:jT;2u+Gs>2GyQU2 Try it online! First, we generate the Fibonacci numbers: u+Gs>2GyQU2 U2 range(2), the list [0, 1] u Apply the follow...

posted 1y ago by isaacg‭  ·  edited 1y ago by isaacg‭

Answer
60%
+1 −0
Challenges Single digit Roman numeral

C, 59 byte h(n){return n&4?n&2?5:n&1?1e3:n&8?50:500:n&2?100:n&1?1:10;} Old version, 60 byte: h(n){return n&4?n&2?5:n&1?1000:n&8?50:500:n&2?100:n&amp...

posted 1y ago by H_H‭  ·  edited 1y ago by H_H‭

Answer
60%
+1 −0
Challenges Hex ​​​detector

Given an integer from 1 to 1000, indicate whether it is a centered hexagonal number[1] (also known as a hex number). What is a hex number? The hex numbers can be visualised as follows: On a he...

4 answers  ·  posted 10mo ago by trichoplax‭  ·  last activity 8mo ago by trichoplax‭

Question code-golf math number
60%
+1 −0
Challenges Most isolated of 3 points

Given 3 points, output one that is separated from its nearest neighbour by the largest distance. Input 3 distinct points (that is, no 2 points are in the same position). Each point is a pair o...

0 answers  ·  posted 10mo ago by trichoplax‭  ·  edited 10mo ago by trichoplax‭

Question code-golf math number
60%
+1 −0
Sandbox Most isolated of 3 points [FINALIZED]

posted 10mo ago by trichoplax‭  ·  edited 10mo ago by trichoplax‭

60%
+1 −0
Challenges The 50 substrings that validate any string of Roman numerals

Haskell, 271 bytes import Data.Char import Data.List n=" IVXLCDM" r x=maximum[if(s`isInfixOf`x)then s else"A"|s<-words$concat$map(\x->(n!!div x 8):[(n!!(x-8*(div x 8)))])$map(\x->ord...

posted 12mo ago by Arpad Horvath‭

Answer