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 14735

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.

1
vote
awk - 32 chars {c=b;b=a;a=$0;$0=b}(b-c)*(a-b)<0 No hope of beating a language like J or APL on brevity, but I thought I'd throw my hat into the ring anyway. Explanation: At any given time, a, b, …
answered Feb 27 '14 by laindir
0
votes
awk - 44 Characters {for(i=NF;i>1;){n=int($i/2);$i%=2;$--i+=n}}1
answered Mar 12 '14 by laindir
2
votes
C - 2468 Not golfed at all, but hopefully it's a starting point for more interesting implementations. The implementation of intersect is cribbed heavily from Adrian Boeing. His pseudo-code was incomp …
answered May 22 '14 by laindir
3
votes
C - 75 This operates on NULL terminated arrays of int *, though it would work equally well for pointers to other types by substituting the appropriate comparison function for **b < **a (e.g., strcmp( …
answered Apr 8 '14 by laindir
1
vote
awk - 115 111 96 85 New version can only handle one line of input. Thanks to durron597 for pointing out that I only need to make sure i <= $1. {for(i=1;++i<=$1;)for(;$1%i+$2%i==0;f[i]++){$1/=i;$2/=i …
answered May 6 '14 by laindir
1
vote
Techniques Thanks to Peter Taylor for pointing out the language-generic version of this question for which I did not bother to search. I'll try to limit this answer to things that are not available …
answered Mar 17 '14 by laindir
0
votes
awk - 53 {for(d=10^9;!int($1/d)||--$2;d/=10);$0=int($1/d)%10}1 trim digits by division, starting with max possible for 32 bit unsigned int when we hit the left side of the integer, int($1 / d) ret …
answered Apr 9 '14 by laindir
5
votes
64 61 characters main(a,b){scanf("%d%d",&a,&b);for(a-=b;a/2;a/=2);putchar(a);} Prints the character values of -1, 0, and 1 for less than, equal to, or greater than, respectively. This implementati …
answered Sep 8 '14 by laindir