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‭

55 posts
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 2y ago by Lundin‭  ·  edited 2y ago by Lundin‭

Answer
66%
+2 −0
Challenges 99 Shortened Bottles of Beer

C (gcc), 244 bytes main(){for(char*w=" bottles of beer on the wall",i=100;--i;)printf("%d%.*s%s, %d%.*s%.8s.\n%s, %d%.*s%s.\n\n",i,i-1?8:7,w,w+8,i,i-1?8:7,w,w+8,i^1?"Take one down and pass it ar...

posted 2y ago by Lundin‭  ·  last activity 2y ago by Lundin‭

Answer
50%
+1 −1
Meta Default Rules: Extensions

The C (gcc) implies extensions - it will only work with that specific compiler under it's default setting GNU17 (equivalent to -std=gnu17), which is mostly a superset of standard C. This also inclu...

posted 2y ago by Lundin‭

Answer
66%
+2 −0
Challenges Coat of Many Colours

C, 534 bytes Strictly conforming program. #include <stdio.h> #include <stdlib.h> #include <string.h> char i=1,**c,**d,*t[30]={"red","yellow","green","brown","scarlet","blac...

posted 2y ago by Lundin‭

Answer
66%
+2 −0
Q&A How to add lots of command line arguments to https://tio.run?

I have a question about everyone's favourite Code Golf editor https://tio.run. After picking a language, is there a sensible way to enter command line arguments to it, other than adding them manual...

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

60%
+1 −0
Challenges Caesar shift cipher

C (gcc), 112 bytes Function solution. p,*a;f(char*s,int n){a=strdup(s);for(s=a;*s;s++)(p=isalpha(*s)?(*s&96)^96?65:97:0)&&(*s=(*s-p+n)%26+p);puts(a);} Try it online! Explanati...

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

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

For the sake of code golf, you first need to decide if you wish to compete in strictly conforming ("real") C, in which case you can't rely on non-standard extensions, poorly-defined behavior or obs...

posted 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
66%
+2 −0
Challenges It's Hip to be Square

C (gcc), 57 64 bytes x,s;main(){scanf("%d",&x);s=sqrt(x);printf("%d",s*s==x);} Try it online!

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

Answer
50%
+1 −1
Meta Is my extension-like library allowed to be used in answers?

If you actually use the library, sure, I guess. How you are going to get it running on online compilers, I have no idea. It's very uninteresting for others to view some code using a custom library ...

posted 3y ago by Lundin‭

Answer
60%
+1 −0
Challenges Evens or Odds - you know this one

C (gcc), 20 bytes f(a){puts("!"+a%2);} Try it online! Function solution. Prints ! in case of even numbers, otherwise just new line.

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

Answer
60%
+1 −0
Sandbox FizzBuzz based on line count

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

Article code-golf
60%
+1 −0
Meta Microcontroller-involving challenges and the rules.

For this to work, I think we need to rule out all start-up code (the C runtime) but also the register maps. So I think answers should be a void main (void){ ... } (or equivalent) function solution ...

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

Answer
60%
+1 −0
Challenges Write a Deadfish Interpreter

C (gcc), 153 bytes a,b;f(char*s){for(char*c,*o="idso";*s;s++)for(c=o;*c;c++)*s==*c&&(b=c-o,a+=!b,a-=b==1,b==2?a*=a:0,b==3&&printf("%d%c",a,s[1]?44:10),a==-1|a==256?a=0:0);} Tr...

posted 3y ago by Lundin‭  ·  edited 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 3y ago by Lundin‭  ·  edited 3y ago by Lundin‭

Answer
60%
+1 −0
Challenges Tile pyramids on top of each other!

C (compliant), 106 bytes char r,i,s[80];void f(int n){memset(s,32,79);for(;r<n;puts(s),r++)for(i=0;i++<n*2;s[n-r-1]=47,s[n+r]=92);} Try it online! Standard C compliant function solutio...

posted 3y ago by Lundin‭

Answer
66%
+2 −0
Sandbox The Tannenbaum series

posted 3y ago by Lundin‭

Article code-golf
60%
+1 −0
Challenges Integer to Roman numeral

C (compliant), 197 198 bytes. Golfed version of the function in the question, using X macros: #define L Y(1000,M)Y(900,CM)Y(500,D)Y(400,CD)Y(100,C)Y(90,XC)Y(50,L)Y(40,XL)Y(10,X)Y(9,IX)Y(5,V)Y(4,I...

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

Answer
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 3y ago by Lundin‭  ·  last activity 3y ago by Lundin‭

Question code-golf
71%
+3 −0
Challenges "Hello, World!"

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

posted 3y ago by Lundin‭

Answer
50%
+0 −0
Challenges Prime Difference

C (gcc), 126 129 bytes N=9999;f(n){int p[N],i,j,P;memset(p,1,N);for(i=P=2;i*i<N;i++)if(p[i]){for(j=i*i;j<N;j+=i)p[j]=0;i-P>=n?j=N:(P=i);}e:return P;} Try it online! This is an integer...

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

Answer
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 3y ago by Lundin‭

Answer
71%
+3 −0
Sandbox Integer to Roman numeral

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