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
 
75%
+4 −0
Q&A Tips for golfing in Python

Use the unpacking * instead of list If you want to convert an iterator/generator into a list, use the * operator instead of using the list function, e.g. Instead of list(iterable) Use [*iter...

posted 3y ago by Moshi‭

Answer
75%
+4 −0
Challenges Make $2 + 2 = 5$

Haskell, 13 bytes 2!2=5 x!y=x+y Try it online!

posted 3y ago by carmysilna‭

Answer
75%
+4 −0
Meta Reactions on Code Golf Codidact

I think "Dangerous" could perhaps stay on. "Outdated" would probably be better off replaced with "Invalid" or something of that sort. I don't think we need "Works for me" or an analog of it at all:...

posted 3y ago by user‭

Answer
75%
+4 −0
Challenges Just the vowels please

Given a sequence of letters, output only the vowels. Input A sequence of letters This may be a string or any ordered data structure of characters (provided it is consistent between inputs) Th...

9 answers  ·  posted 2y ago by trichoplax‭  ·  last activity 2y ago by taoh‭

Question code-golf alphabet
75%
+4 −0
Challenges Knight safe squares

Given a chess board with some knights on it, say how many squares are neither attacked by a knight nor containing a knight. Input An 8 by 8 grid where each square is either a knight or empty T...

3 answers  ·  posted 2y ago by trichoplax‭  ·  last activity 1y ago by Karl Knechtel‭

Question code-golf
75%
+4 −0
Challenges Decoding a non injective bit matrix encoding

The problem Someone has created an encoding format for square bit matrices, however they have found it isn't perfect! One encoding may not decode to exactly one matrix, or it may not even be possi...

0 answers  ·  posted 2y ago by Aftermost2167‭  ·  edited 2y ago by Aftermost2167‭

Question optimization fastest-code encoding code-challenge binary
75%
+4 −0
Challenges Calculate the Z-array

Task Given a list of numbers $X$ produce a second list of numbers $Y$ such that $Y_i$ is the length of the longest common prefix of $X$ and $X$ with the first $i$ elements removed. For example if...

1 answer  ·  posted 2y ago by WheatWizard‭  ·  last activity 2y ago by TheCodidacter, or rather ACodidacter‭

Question code-golf list array
75%
+4 −0
Challenges Encode with ROT13.5

Given a string, convert all of its letters using ROT13, and all of its digits using ROT5. This is sometimes referred to as ROT13.5. Input A sequence of printable ASCII characters (character cod...

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

Question code-golf string encoding
75%
+4 −0
Challenges Probability of rolling all 6 dice faces

The probability of rolling every number from 1 to 6 with $N$ six-sided dice. Input A positive integer $N$. Your code must work for inputs up to and including 10, but may crash, error, or give ...

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

Question code-golf math dice
75%
+4 −0
Challenges Source with the whole alphabet in order of appearance

Python, 88 bytes import abc,code,fcntl,graphlib,json,pickle,cmd,errno,heapq,re,struct,csv,pwd,xml,sys,bz2 Attempt This Online! Requires a Unix-like operating system for fcntl and pwd, and at l...

posted 6mo ago by m90‭

Answer
75%
+4 −0
Challenges Source with the whole alphabet in order of appearance

The challenge is to write as short a source as possible, where the English alphabet (in alphabetical order from top to bottom) "abcdefghijklmnopqrstuvwxyz" is a sub-sequence of the source code. Th...

5 answers  ·  posted 6mo ago by Lundin‭  ·  last activity 6mo ago by Sylvester‭

Question code-golf
75%
+4 −0
Challenges Single digit Roman numeral

Python 3.8+, 51 byte lambda n:((i:="IVXLCDM".index(n))%2*4+1)*10**(i//2) Testing the code: f=lambda n:((i:="IVXLCDM".index(n))%2*4+1)*10**(i//2) for s in "IVXLCDM": print(s, f(s)) T...

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

Answer
75%
+4 −0
Challenges Plain black webpage

HTML, 16 bytes <body bgcolor=0> an attribute that works well for this challenge. tested on Mozilla Firefox. -3 from [Object object]

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

Answer
75%
+4 −0
Challenges Is it stuck in a counting loop?

Given a list of non-negative integers the function $f$ replaces every integer with the number of identical integers preceding it (not necessarily contiguously). So f [1,1,2,2,1,3,3] = [1,2,1,2,3,1...

1 answer  ·  posted 1y ago by WheatWizard‭  ·  last activity 1y ago by isaacg‭

Question code-golf decision-problem list
75%
+4 −0
Challenges Fibonascii Squares

The Challenge Your job is to, given input positive non-zero integer $n$, output an ASCII representation of the tiled Fibonacci squares up to the $n$th number of the Fibonacci sequence. Rules Inp...

2 answers  ·  posted 10mo ago by Sylvester‭  ·  edited 10mo ago by Sylvester‭

Question code-golf ascii-art fibonacci
75%
+4 −0
Challenges Display a Progress Bar

Jelly, 13 bytes 50R>×ɗị⁾-|Ø[j Try it online! Full program only--insofar as supporting the input requirements is concerned. Jelly implicitly Python evals the arguments to every program, so s...

posted 5mo ago by Unrelated String‭

Answer
75%
+4 −0
Challenges Display a Progress Bar

Vyxal 3, 26 bytes ÷50×.5+:'|×'[p$51$-'-×']W“ Vyxal It Online! ÷50×.5+:'|×'[p$51$-'-×']W“­⁡​‎‎⁡⁠⁡‏⁠‎⁡⁠⁢‏⁠‎⁡⁠⁣‏⁠‎⁡⁠⁤‏⁠‎⁡⁠⁢⁡‏⁠‎⁡⁠⁢⁢‏⁠‎⁡⁠⁢⁣‏‏​⁡⁠⁡‌⁢​‎‎⁡⁠⁢⁤‏‏​⁡⁠⁡‌⁣​‎...

posted 5mo ago by Themoonisacheese‭  ·  edited 4mo ago by Themoonisacheese‭

Answer
71%
+3 −0
Sandbox Display a Progress Bar [FINALIZED]

posted 6mo ago by Sylvester‭  ·  edited 4mo ago by trichoplax‭

71%
+3 −0
Challenges Display a Progress Bar

Uiua, 19 bytes $"[_]"⊏⊙"-|">÷⟜⇡50÷ pad $"[_]"⊏⊙"-|">÷⟜⇡50÷­⁡​‎⁠‎⁡⁠⁢⁡⁣‏‏​⁡⁠⁡‌⁢​‎‎⁡⁠⁤⁢‏⁠‎⁡⁠⁤⁣‏⁠‎⁡⁠⁤⁤‏⁠‎⁡⁠⁢⁡⁡‏⁠‎⁡⁠⁢⁡⁢‏‏​⁡⁠⁡‌⁣​‎‎⁡⁠⁤⁡‏‏​⁡⁠⁡‌⁤​‎‎⁡⁠⁢⁣‏⁠‎⁡⁠...

posted 5mo ago by RubenVerg‭  ·  edited 5mo ago by RubenVerg‭

Answer
71%
+3 −0
Challenges Display a Progress Bar

Japt, 18 bytes "[{/V*50 ç| ú-50}] Try it

posted 5mo ago by Shaggy‭

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

Lean is an interactive theorem prover and a functional programming language created in 2013. What tips do you have for golfing in Lean? Tips should be specific to Lean ("remove comments" is not an...

0 answers  ·  posted 8d ago by CrSb0001‭

Question code-golf tips
71%
+3 −0
Challenges How many umbrellas to cover the beach?

You work at a beach. In the afternoon, the sun gets quite hot and beachgoers want to be shaded. So you put out umbrellas. When you put out umbrellas you want to shade the entire beach, with as few ...

2 answers  ·  posted 1y ago by WheatWizard‭  ·  last activity 1y ago by justhalf‭

Question code-golf array
71%
+3 −0
Challenges 12-hour time is weird

Your mission for today, should you choose to accept it, is to write a simple 12-hour clock calculator. Your input will always be in the form of arg op arg, where op is either + or -, and arg is eit...

0 answers  ·  posted 1y ago by honnza‭

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

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

71%
+3 −0
Challenges Plain black webpage

This is a language specific challenge, for HTML only. Your answer is the content of a self contained HTML file, that when opened in a web browser gives a plain black page. Requirements The HTM...

4 answers  ·  posted 1y ago by trichoplax‭  ·  last activity 1y ago by Razetime‭

Question code-golf internet html