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 Lundin‭

60 posts
83%
+8 −0
Challenges Integer to Roman numeral

The task is to take a decimal integer as input and print the corresponding Roman numeral with capital letters. The program must handle all positive integer numbers between 1 and 1000. Input can be...

3 answers  ·  posted 4y ago by Lundin‭  ·  last activity 4y ago by Lundin‭

Question code-golf
81%
+7 −0
Challenges Output 256 in many different ways

C, 8 solutions Standard C, no extensions. 1 solution snippet per line: "llll"[3]^33^333 4*4*4*4 5555-555-555-555-555-555-555-555-555-555-55-55-55-55-55-5-5-5-7-7 6666/26 (int){8<...

posted 4y ago by Lundin‭

Answer
80%
+6 −0
Challenges Keyword golfing

Many programming languages have the concept of keywords, special syntax items that are not just identifiers reserved by some library, but words reserved by the language itself. The challenge is to...

6 answers  ·  posted 3y ago by Lundin‭  ·  last activity 1y ago by H_H‭

Question code-golf
80%
+6 −0
Challenges Golf golf challenge

The task is to create a program which displays a golf score as text. It takes 2 numbers as input, separated by space or new line: The first number is the par of the specific hole. The second nu...

5 answers  ·  posted 3y ago by Lundin‭  ·  last activity 3y ago by radarek‭

Question code-golf
80%
+6 −0
Meta Reactions on Code Golf Codidact

None of these are applicable at least not for Code Golf challenges. I think this community should "opt out" of reactions unless we can come up with more relevant ones. "Works for me". Answers ...

posted 3y ago by Lundin‭

Answer
80%
+6 −0
Meta Can we have [popularity-contest]s?

Well... maybe not in combination with a code golf challenge, but more like an artistic challenge with some theme, similar to screenshot of the month? For reference see for example Outdoors photo co...

posted 3y ago by Lundin‭

Answer
77%
+5 −0
Meta What are the rules of programming language compliance?

Code Golf seems like a fun idea to me, since I'm a programmer by trade and "language lawyer" nerd as a hobby. But every time I checked the code golf site on SE, I dismissed it as nonsense, because...

2 answers  ·  posted 4y ago by Lundin‭  ·  last activity 4y ago by Quintec‭

Question support discussion
77%
+5 −0
Challenges Make $2 + 2 = 5$

C (gcc), 30 bytes f(x,y){return x+y|!(x^y|x^2);} Try it online! In case the "preferably on a function" requirement can be dropped, then #define f(x,y)x+y|!(x^y|x^2) is 28 bytes.

posted 3y ago by Lundin‭  ·  edited 3y ago by Lundin‭

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 1mo ago by Lundin‭  ·  last activity 21d ago by Sylvester‭

Question code-golf
75%
+4 −0
Challenges Can you give me half?

C (gcc), 8 7 unique cos(cos-cos)/(cos(cos-cos)-(-cos(cos-cos))) Try it online! -1 unique character thanks to @orthoplex‭

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

Answer
75%
+4 −0
Challenges Operation "Find The Operator"

C (gcc), 147 151 bytes #define L(X)X(+,a+b)X(-,a-b)X(*,a*b)X(/,b&&a/b)X(%,b&&a%b)X(^,pow(a,b)) #define M(o,d)printf("%s",d==c?#o" ":z++==5?".":""); z;s[99];f(a,b,c){L(M)} Tr...

posted 3y ago by Lundin‭  ·  edited 3y ago by Lundin‭

Answer
75%
+4 −0
Meta Default Rules: Code Golf I/O

Command-line arguments may be used as input instead of stdin Languages/systems that support reading input from command-line arguments may use those as input instead of reading from stdin.

posted 3y ago by Lundin‭

Answer
75%
+4 −0
Challenges Truthify an array

C (gcc), 100 bytes i,j;f(x,y,p)int*p;{puts("[");for(;i<x;i++)for(j=0;j<y;j++)*p++&&printf("[%d,%d],",i,j);puts("\b]");} Try it online! Note that TIO console doesn't handle back...

posted 4y ago by Lundin‭  ·  edited 4y ago by Lundin‭

Answer
75%
+4 −0
Challenges Reverse an ASCII string

C (gcc), 62 bytes main(){char b[99],*p=strchr(gets(b),0);for(;p-->b;)putch(*p);} This relies on the usual gcc extension abuse. It assumes that max user input is 98 characters + null term, si...

posted 4y ago by Lundin‭  ·  edited 3y ago by Lundin‭

Answer
71%
+3 −0
Challenges Guess the language! (Cops' Thread)

C or C++ (gcc) 220 bytes, cracked by Razetime %: %: define cops(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t) if(not false and k%:%:f%:%:d%:%:l(& (not true) <:%:i%:j%:k%:l" "%:m" "%:n%:o%:p%:...

posted 3y ago by Lundin‭  ·  edited 3y ago by Lundin‭

Answer
71%
+3 −0
Sandbox Golf golf challenge [FINALIZED]

posted 3y ago by Lundin‭  ·  edited 1y ago by trichoplax‭

71%
+3 −0
Challenges "Hello, World!"

LOLCODE, 37 bytes HAI 1 VISIBLE "Hello, World!" KTHXBYE Try it online!

posted 4y ago by Lundin‭

Answer
71%
+3 −0
Sandbox Keyword golfing [FINALIZED]

posted 3y ago by Lundin‭  ·  edited 1y ago by trichoplax‭

71%
+3 −0
Sandbox Integer to Roman numeral

posted 4y ago by Lundin‭  ·  edited 4y ago by Lundin‭

71%
+3 −0
Q&A Hosting fastest code challenges

If restricting everyone to the same system, then we can force every contestant to use https://tio.run and the on-site bench-marking found below "debug" -> "real time" as efficiency metric. Examp...

posted 1y ago by Lundin‭  ·  edited 3mo ago by Lundin‭

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

C (gcc), 108 bytes *h,i;main(){for(;i++<100;){char s[]="%dFizzBuzz ",b=i%5;h=s+2;printf(s+(i%3?b?*h=32,0:6:b?h[1]=32,2:2),i);}} Godbolt. Works on clang too. Contains some serious abuse of al...

posted 4y ago by Lundin‭  ·  edited 4y ago by Lundin‭

Answer
66%
+2 −0
Challenges In The Jailhouse Now

C (gcc), 119 118 116 115 bytes #define p(x,y,z) printf(i^1?i^c?#z:#y:#x) i,j;f(c){for(i=1;i<=c;p(╗\n,╝\n,╣\n),i++)for(j=p(╔,╚,╠);j++<c;)p(╦,╩,╬);} Try it online! Function solution. I...

posted 3y ago by Lundin‭  ·  edited 3y ago by Lundin‭

Answer
66%
+2 −0
Challenges Repeat the characters

C (gcc), 56 bytes i;f(s,n)char*s,n;{for(;*s;s++)for(i=n;i--;putchar(*s));} Try it online! My attempt at recursion ended up at 61 bytes: o;f(s,n)char*s,n;{for(o=n;*s&&n--;putchar(*...

posted 3y ago by Lundin‭

Answer
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