+ 3
What's the most complicated code you've written?
5 Respuestas
+ 4
The most complicated code I've written is for the Riemann ζ function (which is an extremely important function in mathematics).
The task involved translating a certain definition of the function from mathematical notation to *efficient* JavaScript code. The result comprises a nested pair of for loops and ten variables.
function zeta(s) /* Riemann's zeta function */ {
var y0 = [0, 0];
var a = 1;
var b = 1;
var y1, c, d, k, sign;
for (var n = 0; n < 64; n++) {
y1 = [0, 0];
a /= 2;
c = 1;
d = b;
sign = 1;
for (k = 0; k <= n; k++) {
y1 = add(y1, div([b * sign / (c * d), 0], pow([k + 1, 0], s)));
if (n != k) {
d /= n - k;
}
c *= k + 1;
sign *= -1;
}
b *= n + 1;
y0 = add(y0, mul(y1, [a, 0]));
}
return div(y0, sub([1, 0], pow([2, 0], sub([1, 0], s))));
}
+ 3
Mine might be the function 'prettily' that aims at making console output look like a page of a novel.
https://code.sololearn.com/cx5AbYU28x9Z/?ref=app
+ 3
It will be my genetic algorithm
https://code.sololearn.com/cYOp0uUrdH6N/?ref=app
0
Movie web scraper addon for Kodi media player
0
I dont have it here, but its fuzzy algorithm for weather prediction