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 »

Posts by celtschk‭

70 posts
60%
+1 −0
Challenges Digit antitranspose

Python 3, 35 bytes lambda m:list(zip(*m[::-1]))[::-1] Try it online! The format is a list of tuples. The content of the tuples could be any type; in my tests I used single-digit strings bec...

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

Answer
50%
+0 −0
Challenges Encode with ROT13.5

Bash, 31 bytes tr a-zA-Z0-9 n-za-mN-ZA-M5-90-4 Try it online!

posted 1y ago by celtschk‭

Answer
71%
+3 −0
Meta Thoughts on hiding challenge sections with expandable details tags

I think everything strictly needed to write or judge a solution should never be hidden. If you feel it is too large, think about how to shorten it. Information that is not strictly necessary can b...

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

Answer
50%
+0 −0
Challenges Presumptuous base conversion

C (gcc), 117 bytes b,r;f(char*s){char*p=s;for(;*p;p++)*p-=47+7*(*p>57),b=b<*p?*p:b;if(b<2)return p-s;for(;*s;s++)r*=b,r+=*s-1;return r;} Try it online!

posted 1y ago by celtschk‭

Answer
50%
+0 −0
Challenges Cumulative Counts

Python 3, 74 bytes def f(a): d={x:0 for x in a};r=[] for x in a:d[x]+=1;r+=[d[x]] return r Try it online!

posted 2y ago by celtschk‭

Answer
60%
+1 −0
Challenges Roll n fair dice

Python 3, 59 bytes lambda n,m:sum(choices(range(m),k=n))+n from random import* Try it online!

posted 2y ago by celtschk‭

Answer
60%
+1 −0
Meta Does Looping Counter qualify as kolmogorov-complexity?

Lundin just suggested in a comment under another question that I tag the challenge Looping Counter as kolmogorov-complexity. Now I'm not sure if it actually qualifies for that tag, for the followi...

1 answer  ·  posted 2y ago by celtschk‭  ·  last activity 2y ago by Razetime‭

Question discussion tags
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 2y ago by celtschk‭  ·  last activity 2y ago by Quintec‭

Question discussion rules
84%
+9 −0
Challenges Looping counter

Looping counter Create an infinite loop that outputs lines of asterisks, with each line containing one more asterisk. Instead of the asterisk, any printable, non-whitespace character can be used. ...

19 answers  ·  posted 2y ago by celtschk‭  ·  last activity 8mo ago by H_H‭

Question code-golf
50%
+0 −0
Challenges Reverse an ASCII string

SOS, 76 bytes +>+>?<+>?<+>?<+>?<+>?<+>?<+>?<+>?<<)<<-(>{>!<{>!<{>!<{>!<{>!<{>!<{>!<{>!&l...

posted 2y ago by celtschk‭

Answer
71%
+3 −0
Sandbox Looping counter [FINALIZED]

posted 2y ago by celtschk‭  ·  edited 11mo ago by trichoplax‭

50%
+0 −0
Challenges "Hello, World!"

SOS, 155 Bytes !+!-!!+!-!!!!+!!-!!+!-!+!-!+!!-!+!!-!!!+!!-!+!!-!!!+!!-!+!!!!-!!+!-!+!!-!!!!+!-!!!!!!+!-!+!-!+!!!-!+!!-!+!!!!-!+!!!-!!+!-!!+!!-!+!!-!!!+!!-!!+!-!!+!-!!!!+! Explanation: Each ! o...

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

Answer
60%
+1 −0
Sandbox Word wrap a string

posted 2y ago by celtschk‭

Article code-golf string
81%
+7 −0
Challenges Determine whether an integer is square-free

An integer is called square-free if it is not a multiple of a perfect square other than 1. For example, 42 is square-free, but 44 is not because it is a multiple of the perfect square 4 = 2². Your...

13 answers  ·  posted 2y ago by celtschk‭  ·  last activity 1y ago by Shaggy‭

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

C (gcc), 64 62 bytes Saved 2 bytes thanks to m90 in the comments. i;f(char*s){i=atoi(s)>>4;return'A'+(i&8?i&4?i&2?i%2+3:2:1:0);} Try it online!

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

Answer
75%
+4 −0
Challenges Golf golf challenge

C (gcc), 133 131 bytes f(p,s){char*t="Hole in one\0Albatross\0Eagle\0Birdie\0Par\0Bogey\0Double bogey\0Triple bogey";for(--s?s+=5-p:0;s-=!*t++;);puts(t);} Saved two bytes thanks to m90 in the...

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

Answer
60%
+1 −0
Challenges 1, 2, Fizz, 4, Buzz!

C (gcc), 103 bytes Using a different approach than my previous solution, therefore posting as new answer as suggested here. i;main(){while(i++<100){char s[]="FizzBuzz",*t=s+4*!!(i%3);if(i%5)...

posted 2y ago by celtschk‭

Answer
77%
+5 −0
Meta New solution to same challenge in same language: Change existing answer or add new one?

A while ago I wrote an answer in C (gcc) to the FizzBuzz challenge. Now I've found a shorter solution for the same compiler, which however uses a completely different strategy. Now I wonder if I s...

1 answer  ·  posted 2y ago by celtschk‭  ·  edited 7mo ago by trichoplax‭

75%
+4 −0
Challenges Implement Rule 110

[Rule 110] is a Turing complete cellular automaton. It is defined as follows: Take as initial value a sequence of symbols that's infinite to both sides, which consists only of two different symbol...

1 answer  ·  posted 2y ago by celtschk‭  ·  last activity 2y ago by Moshi‭

66%
+2 −0
Q&A Tips for golfing in C

Use pointer arithmetic and \0 with string literals In C, strings are just zero-terminated character arrays, which means you can play tricks with pointer arithmetic. For example, the line char*s=a...

posted 2y ago by celtschk‭

Answer
71%
+3 −0
Challenges Operation "Find The Operator"

Python 3, 106 91 bytes Saved 15 bytes thanks to Moshi in the comments lambda a,b,c:[p for p in"+ - * // % **".split()if(p in'+-**'or b)and eval(f"{a}{p}{b}")==c] Try it online!

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

Answer
66%
+2 −0
Sandbox Implement Rule 110 [FINALIZED]

posted 2y ago by celtschk‭  ·  edited 11mo ago by trichoplax‭

71%
+3 −0
Challenges Run-length encode a byte sequence

Run-length encoding is a simple compression technique which compresses sequences of repeating identical bytes. The encoding rules for this task are as follows: Any sequence of $n$ identical bytes...

2 answers  ·  posted 2y ago by celtschk‭  ·  last activity 2y ago by Moshi‭

Question code-golf encoding
71%
+3 −0
Challenges Find good coalitions

As you might know, there were elections in Germany, and now the parties have to form a government coalition. Let's help them with it! A good coalition has the strict majority of seats (that is, mo...

2 answers  ·  posted 2y ago by celtschk‭  ·  last activity 2y ago by Moshi‭

Question code-golf