Fastest algorithm

Chat about anything not covered in these forums, but keep it civil!

Post » Wed Mar 09, 2011 2:17 pm

lol someone did this which is crazy smart, 125 chars

for(a=[j=p=2];j<123;)a[j]?p%a[++j]<1&&p++&&(j=0):(a[j]=p,j=0);function b(c,i){return c[i=i||0]?a[c.charCodeAt(i)]*b(c,++i):1}

alert(b("toba")==b("boat"));
Image Image
Scirra Founder
B
125
S
37
G
25
Posts: 3,945
Reputation: 44,922

Post » Fri Mar 11, 2011 9:29 pm

but why the horrible formatting? It just makes it look more complicated :P

VERBOSITY!
B
2
S
2
G
5
Posts: 448
Reputation: 2,546

Post » Thu Jun 13, 2013 2:45 pm

Hey, that's what I'm looking for!
Sorry for the delay but how would you do the javascript trick within construct2?
capx is welcomed :)
B
12
S
2
G
3
Posts: 16
Reputation: 2,813

Previous

Return to Open Topic

Who is online

Users browsing this forum: No registered users and 0 guests