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
Sandbox Digit balanced numbers [FINALIZED]

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

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

Assignment expressions (Python 3.8+) The assignment expression (aka the walrus operator) := was introduced in Python 3.8 as a result of PEP 572, which can be used inline to assign a variable as pa...

posted 3mo ago by CrSb0001‭

Answer
60%
+1 −0
Challenges Print the modular multiplicative inverse / virtual fractions

Python 3.8, 44 bytes Uses a modulus of 2**16 == 4**8 == 65536. for i in range(1,98,2):print(pow(i,-1,4**8)) How it works: for i in # Iterator ra...

posted 3mo ago by CrSb0001‭

Answer
60%
+1 −0
Challenges Convert to Hexadecimal

JavaScript (Node.js), 60 bytes n=>{for(l='';n;l="0123456789ABCDEF"[n%16]+l,n>>=4);return l} Try it online! Explanation n=>{for(l='';n;l="0123456789ABCDEF"[n%16]+l,n>>=4);ret...

posted 23d ago by hydroxyl-radical‭  ·  edited 23d ago by hydroxyl-radical‭

Answer
60%
+1 −0
Challenges Net​​ or​​ not?

Python 3, 463 400 343 338 bytes -63 bytes thanks to trichoplax's suggestion to remove spaces -57 bytes by simple conversion to base 36 -5 bytes by removing base= (seriously, how did I miss t...

posted 23d ago by hydroxyl-radical‭  ·  edited 18d ago by hydroxyl-radical‭

Answer
60%
+1 −0
Meta Default-rules is a mod only tag but is suggested with the required tags

When creating a new post, at least one of the required tags listed above the Tags field must be added. The first 4 of these can be added by anyone, but "default-rules" is a moderator only tag. For...

0 answers  ·  posted 23d ago by trichoplax‭

Question discussion tags
60%
+1 −0
Challenges Print the modular multiplicative inverse / virtual fractions

Lean4, 113 56 bytes #eval(λx=>x^32767%4^8)<$>(λx=>1+x*2)<$>(List.range 49) Try it online! Something to notice is that you apparently don't need type signatures in functions...

posted 21d ago by CrSb0001‭  ·  edited 20d ago by CrSb0001‭

Answer
60%
+1 −0
Challenges Integer to Roman numeral

Lean 4, 232 bytes def r(i):=Id.run do let M:=[999,899,499,399,99,89,49,39,9,8,4,3,0] let N:=["M","CM","D","CD","C","XC","L","XL","X","IX","V","IV","I"] let mut s:="" let mut n:=i for x in Lis...

posted 20d ago by CrSb0001‭

Answer
60%
+1 −0
Challenges Substring factor

Japt v1.4.5, 7 bytes â¬d!øUs Try it â¬d!øUs :Implicit input of integer U ⬠:Divisors, excluding itself d :Are any !ø : Contained in Us : The s...

posted 10mo ago by Shaggy‭

Answer
60%
+1 −0
Meta Default Rules: Code Golf Answer Types

Complete program A code golf answer can be a complete program. This means that the code can be interpreted or compiled (as appropriate) without any additional source code.

posted 10mo ago by trichoplax‭

Answer
60%
+1 −0
Challenges Multiplicative perfection

Vyxal, 4 bytes KΠ√= Try it Online! Another 4 byter, but uses the definition of A007422 that a number returns true if product(divisors) == input ** 2. Explained KΠ√=­⁡​‎‎⁡⁠⁤‏‏​⁡⁠⁡‌⁢​‎‎⁡...

posted 9mo ago by lyxal‭

Answer
60%
+1 −0
Challenges How many odd digits?

C (gcc), 41 bytes r;o(char*s){for(;*s;r+=*s++&1);return r;} Try it online! This is under the assumption that in a function solution, input has to be passed as parameter and output throug...

posted 8mo ago by Lundin‭  ·  edited 8mo ago by Lundin‭

Answer
60%
+1 −0
Challenges How many odd digits?

C (gcc), 37 bytes This takes an integer as input. It uses the fact that the last digit is odd if and only if the number is odd, and that integer division by 10 removes the last digit. Testing if ...

posted 8mo ago by celtschk‭  ·  edited 8mo ago by celtschk‭

Answer
60%
+1 −0
Challenges Multiplicative perfection

C (gcc), 53 bytes This uses the shortcut behaviour of logical or (||) to only multiply if it is a divisor; the loop end condition then makes sure it's a proper divisor. i=1;p=1;f(n){for(;i<n...

posted 8mo ago by celtschk‭

Answer
60%
+1 −0
Sandbox Product of polynomials modulo 2 in integer representation

posted 8mo ago by celtschk‭  ·  edited 8mo ago by celtschk‭

Article code-golf math
60%
+1 −0
Challenges Fibonacci without consecutive digits

Japt, 17 bytes 0-indexed gU²o!gM fÈì äa eÉ Try it 15 bytes 1-indexed @µXì äa eÉ}f!gM Try it

posted 10mo ago by Shaggy‭

Answer
60%
+1 −0
Challenges Substring factor

JavaScript, 42 bytes s=>(g=n=>--n&&s.includes(s%n?g:n)|g(n))(s) Try it online!

posted 10mo ago by Shaggy‭

Answer
60%
+1 −0
Challenges Multiplicative perfection

JavaScript, 36 bytes n=>n==(g=d=>--d?(n%d?1:d)*g(d):1)(n) Try it online!

posted 9mo ago by Shaggy‭

Answer
60%
+1 −0
Challenges Net​​ or​​ not?

Given a hexomino, indicate whether it is a net of a cube. Input A 6 by 6 grid containing exactly 6 filled squares. The 6 filled squares will be in a single edge connected set (a hexomino). Th...

3 answers  ·  posted 11mo ago by trichoplax‭  ·  last activity 15d ago by trichoplax‭

Question code-golf math decision-problem
60%
+1 −0
Meta Leaderboard sorting bug

Some time has passed, and the leaderboard there now looks like this: It appears that the entry showing as undefined is confusing the leaderboard. I don't know what governs the placement of that...

posted 11mo ago by Monica Cellio‭

Answer
60%
+1 −0
Challenges Find the IP address class

Japt, 15 bytes Port of m90's JS solution, until I manage to come up with something shorter. ;Bg7^Mm8|#ÿ^3îU Try it

posted 8mo ago by Shaggy‭  ·  edited 8mo ago by Shaggy‭

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

UiuaSBCS # Experimental!, 8 bytes ++↧∩=₂,, Try it here! Explanation ++↧∩=₂,, ,, Make a copy of the two arguments ∩=₂ Are they both equal to 2? ↧ Minimum ++ Add the...

posted 8mo ago by Europe2048‭

Answer
60%
+1 −0
Sandbox Plain ​​spheres

posted 11mo ago by trichoplax‭  ·  edited 8mo ago by trichoplax‭

60%
+1 −0
Meta Default Rules: Code Golf Answer Types

When answering a code-golf challenge, what types of answer are acceptable by default? Can an answer be a complete program, a function, an anonymous function, a snippet of code? Please add one type...

4 answers  ·  posted 10mo ago by trichoplax‭  ·  edited 10mo ago by C. K. Young‭

Question default-rules discussion
60%
+1 −0
Meta Default Rules: Code Golf Answer Types

Function Score is the bytes of the function A code golf answer can be a function. Only the bytes required to define the function are included in the score. Score includes imports and definitions...

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

Answer