Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Favorites infavorites:mine
infavorites:1234
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with Search options user 36046

Code-golf is a competition to solve a particular problem in the fewest bytes of source code. If you want to score by characters instead of bytes, please state this explicitly in the challenge. If source code length is not the primary scoring criterion, consider using another tag instead.

2
votes
C (clang), -DZ=lseek(d,0 + 139 = 152 bytes g,j,x,d,s,i,c;f(n){x=0;d=open(n,2);s=Z,2);for(j=2;j--;x++){Z,0);for(i=s;i--;write(d,&x,1));Z,0);for(i=s;i--;read(d,&c,1),c!=x&&x--&&j--);}} Try it onlin …
answered Oct 29 '18 by Logern
0
votes
C++ (gcc), 105 104 bytes #import<bits/stdc++.h> f(){for(char*n;~scanf("%ms",&n);)std::set<int>(n,n+strlen(n)).size()<8&&puts(n);} Try it online! -1 byte thanks to @ceilingcat
answered Nov 9 '18 by Logern
1
vote
x86 machine code (Linux), 116 bytes 00000000: 89cb 6a02 5931 d289 4c24 f4b0 05cd 8050 ..j.Y1..L$.....P 00000010: 5b53 6a02 5a31 c9b0 13cd 8089 c65b 5331 [Sj.Z1.......[S1 00000020: d231 c9b0 13cd 80 …
answered Oct 30 '18 by Logern
2
votes
C (clang), 60 bytes f(a,b,c)int*c;{for(*c++=a,*c++=b;(a<b?++a<b:--a>b);*c++=a);} Try it online!
answered Nov 9 '18 by Logern
1
vote
C (gcc), 89 71 bytes g(x,s,p,f,i){for(s=x%10,p=f=i=1;x/=10;s+=x%10)p=p*10+1,f*=i++;x=s*p*f;} Try it online! -18 bytes thanks to @nwellnhof
answered Oct 20 '18 by Logern
0
votes
C (clang), 57 54 bytes i;f(int*a){for(i=0;a[i++];printf("%S%.*S ",a+i,i,a));} Try it online! Takes input as a wide string.
answered Dec 10 '18 by Logern
1
vote
C (clang), -DT=t=strtok -DZ=" ") 178 113 106 105 95 91 bytes i;f(*a){char*t;for(T(a,Z;t;printf(Z,T(0,Z)for(i=0;t[i];)printf(t+i++);} Try it online!
answered Sep 21 '18 by Logern
0
votes
sed, 56 53 bytes s/^(.*),(.*)\1$/\2/ s/^(.*),\1(.*)$/\2/ s/.*,(.*)/\1/ Try it online!
answered Sep 28 '18 by Logern
0
votes
Z80Golf, 34 bytes 00000000: dde1 f1b7 2819 fe30 2812 4504 aff5 3cf5 ....(..0(.E...<. 00000010: d1f1 82d5 f510 f9c1 f17c 8067 2c18 e3dd .........|.g,... 00000020: e5c9 …
answered Oct 10 '18 by Logern
1
vote
C (clang), 168 159 153 119 bytes g,i,j;f(char*a){for(i=0;a[j=i++];islower(a[i])?g=a[j],bcopy(a,a+1,j),*a=g:isupper(a[i])?g=*a,bcopy(a+1,a,j),a[j]=g:0);} -26 thanks to @ceilingcat Try it online!
answered Sep 22 '18 by Logern
8
votes
x86 machine code, 39 bytes 00000000: 6a01 5e6a 055f 5251 31c0 39d1 0f44 c601 j.^j._RQ1.9..D.. 00000010: d139 cf0f 44c6 595a 29d1 83f9 050f 44c6 .9..D.YZ).....D. 00000020: 83f9 fb0f 44c6 c3 …
answered Jan 16 by Logern
0
votes
JavaScript (Node.js), 199 bytes a=()=>console.log(require('fs').readFileSync(0)+'');a();var a=a||0;b=()=>console.log(require('fs').readFileSync(0)+'');!a?b():c=()=>console.log(`a=${a};a();var a=a| …
answered Oct 21 '18 by Logern
0
votes
x86 machine code, 19 bytes 00000000: 31c0 8b19 83e3 3f41 b21a f7e2 01d8 3831 1.....?A......81 00000010: 75f0 c3 u.. Assembly: section .text global func func: …
answered Oct 21 '18 by Logern
1
vote
C (clang), 246 223 220 210 208 193 188 bytes Compiler flag -DF=;for(i=0;b[i];i++ -DB=b[i] (29 bytes) Added mixed case support. f(char*c){char m,i,s,*b,a[255]={0};s=asprintf(&b,c)F)B=tolower(B),a[B …
answered Oct 4 '18 by Logern
1
vote
Java (JDK)/JavaScript (Node.js), 154 bytes class P{P(){var s="This program errors out in ";try{System.out.printf("%sJava :P",s);}finally{if(1!='1'){var a=0/0;}throw new Error(s+"JavaScript :P");}}} …
answered Oct 11 '18 by Logern

15 30 50 per page