As of May 31, 2023, we have updated our Code of Conduct.

# Search Results

Results tagged with
Search options not deleted user 39407
89 results

Code-golf is a competition to solve a particular problem in the fewest bytes of source code.

1 vote

### Merge two values

Glee, 24 22 20 bytes Idea to append zero taken from Sok’s Pyth solution. =>n,0& *>0\+ >1~ *n\>> =>n,0& *>0\+ <2*n\>> <2 instead of >1~ (not > 1) Explanation: a b=>n,0& *>0\+ <2*n\>> a b …
• 3,235

### Merge two values

Q'Nial7, 40 bytes n is OP A B{2>sum(cull A B 0>0)*max A B} n is OP A B{ } operation n with parameters A B (pair of numbers) A B 0 ap …
• 3,235

### The "Do While False" idiom

beeswax, 26 bytes Interpreting 0 as false, 1 as true. E< Dd"C~< _T~T~A"b`B Output: julia> beeswax("codegolfdowhile.bswx",0,0.0,Int(20000)) i1 i1 AB Program finished! julia> beeswax("codegolfdo …
• 3,235
1 vote

### Shortest auto-destructive loop

DUP, 10 bytes (8 chars) Conor O'Brien already wrote the shortest possible solution in FALSE which is also a valid DUP program. DUP is a direct descendant of FALSE and FALSE is almost a complete subse …
• 3,235
1 vote

### Play the "bzzt" game

beeswax, 148 bytes beeswax was created after the challenge, but why shouldn’t I give the challenge a try anyway? ;) Not golfed to death yet, but it satisfies both requirements: ;pK~gFP{?gp' …
• 3,235
1 vote

### Shortest auto-destructive loop

Julia, 19 bytes for i=1:2 "a"[i]end The first loop accesses string "a" at index [1], which is char 'a', the second loop tries to access string "a" at index [2] and throws a BoundsError: julia> for …
• 3,235

### Shortest code to produce infinite output

Piet, 3 codels ==> <== here it is ;) Just to make it visible, the same at codel size 10: This program bounces forward and backward, executing: forward direction: 1 PSH (push on stack) OUN (ou …

• 3,235
1 vote

### Shortest infinite loop producing no output

Staq, 2 bytes () ( jump to corresponding ) if the top stack value is greater than 0 ) jump back to corresponding ( if the top stack value is 0 (or if it does not exist)
• 3,235