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 16278

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.

0
votes
JavaScript - 141 137 125 I don't like regex :) function g(a){i=o=[],a=a.split('');for(s=1;i<a.length;){l=a[i++];if(b=l==a[i])s++;if(!b|!i){o[l]=o[l]>s?o[l]:s;s=1}}return o} Run console.log(g("ac …
answered Jun 25 '14 by Matt
1
vote
JavaScript - 286 w=prompt().split('');for(i=0;i<w.length;i++){z=w[i];o="o",p=".";b=[1,5,3,11,9,7,15,13,6,14];e=[c="",1,3];g=z.charCodeAt(0)-97;if(g>22)g--;f=e[g/10|0];d=b[g%10];if(g==22){d=14;f=2;}c+ …
answered Jul 4 '14 by Matt
16
votes
24answers
Appended Numbers Game Write a function/program that takes 2 integer parameters integer parameters or integer variables, a start number, and a max iterations count. The code should perform the followi …
asked May 19 '14 by Matt
1
vote
JavaScript - 244 Accepts a parameter of string with newlines. function s(z){n=m="",y=[];z.toLowerCase().split("\n").map(function(g){a=[];g.replace(/ /g,n).split(n).map(function(e,i){if((+y[e]|0)<(a[ …
answered Apr 10 '14 by Matt
1
vote
JavaScript - 170 function s(a,e){o="",b=a.length,x=b/e|0,y=b-x*e;for(c=1;c<=e;c++){r="*";o+=Array((c-1)*x+1).join(r)+a.substr(c*x-x,c==e?x+y:x)+Array(c<e?b-c*x+1:0).join(r)+"\n"}return o} Quick one …
answered Apr 3 '14 by Matt
0
votes
JavaScript - 155 function p(s,d){s=s.split(/\\|\//g);d=d.split(/\\|\//g);o=[];for(i=0;s[i]==d[i];i++);for(j=s.length-i;j--;)o[j]="..";return o.concat(d.slice(i)).join("/")} Parses either path forma …
answered Jun 26 '14 by Matt
1
vote
JavaScript - 212 w=prompt(o=[]).split(",");w.map(function(k,l){for(i=0;++i<k.length;){p=k.slice(0,i);if(w.filter(function(r,t){return t!=l}).every(function(r){return r.indexOf(p)}))o.push(p+":"+k)}o. …
answered May 22 '14 by Matt
1
vote
JavaScript - 273 256 235 p=prompt(s=j="\n")-1;z=" answer",w=" accept",x=" upvoted"+j,y=w+"ed",v=" question",u=" downvoted";if(m=p/15|0)s+=m+z+y+j;r=p-m*15;if(m=r/10|0)s+=m+z+x;r-=m*10;if(m=r/5|0)s+=m …
answered Mar 31 '14 by Matt
0
votes
JavaScript - 42 characters without declaration function s(x){return x.join(" ").length+1} Usage: a=["abc","bdef","cee","deee"];console.log(s(a));
answered Mar 31 '14 by Matt
0
votes
JavaScript - 92 I believe this is what is asked for. function s(a,b){c=[];a.map(function(e){c[b(e)]=e});return c.filter(function(f){return !!f})} Test: console.log(s([{id:3},{id:5},{id:7},{id:1}] …
answered May 13 '14 by Matt
1
vote
JavaScript - 133 function m(a,b){c=[];for(i=j=0;i<a.length&j<b.length;)c.push(a[i]<b[j]?a[i++]:b[j++]);return c.concat(a.slice(i)).concat(b.slice(j))} Same sort of approach as OP's.
answered Apr 8 '14 by Matt
29
votes
JavaScript - 184 169 (with jQuery) b="input",a="<input type=checkbox>",c=":checked";$("body").html("SELECT ANY TWO"+a+"FAST"+a+"GOOD"+a+"CHEAP").click(function(){$(b).not(c).attr("disabled",!!$(b+c …
answered May 8 '14 by Matt
4
votes
JavaScript - 172 Function itself is 172: //build persistent seats m=[]; for(i=10;i--;){m[i]={r:String.fromCharCode(i+65),s:[]};for(j=0;j<15;j++)m[i].s.push(j+1);} function b(z){for(i=0;i<m.length;i …
answered May 23 '14 by Matt
1
vote
JavaScript - 199 text="qwertyuiopasdfghjklzxcvbnm"; pattern="***** * ***\n* * * *\n* * * *\n***** * ***"; function p(a,c){z=c.length,y=a.length,x=0;for(i=z;i-->0;)if(c[i]=="*")x+=1;if(x-y>0)for( …
answered May 6 '14 by Matt
0
votes
JavaScript - 246 Basic JS generator: z=Math.random;y=(z()*200|0)+1900;o=(""+y).slice(-2)+("0"+(z()*12|0+(y>1999?21:1))).slice(-2);o+=("0"+(z()*31|0+1)).slice(-2);o+=("00"+(z()*999|0)).slice(-3);o+=z …
answered Apr 14 '14 by Matt

15 30 50 per page