+ 3

What's the most complicated code you've written?

2nd Dec 2018, 10:21 PM
Erik Johanson
Erik Johanson - avatar
5 ответов
+ 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)))); }
2nd Dec 2018, 10:28 PM
Erik Johanson
Erik Johanson - avatar
+ 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
2nd Dec 2018, 10:42 PM
HonFu
HonFu - avatar
+ 3
It will be my genetic algorithm https://code.sololearn.com/cYOp0uUrdH6N/?ref=app
4th Dec 2018, 11:14 AM
Julian
Julian - avatar
0
Movie web scraper addon for Kodi media player
2nd Dec 2018, 11:21 PM
Toni Isotalo
Toni Isotalo - avatar
0
I dont have it here, but its fuzzy algorithm for weather prediction
3rd Dec 2018, 3:39 AM
Taste
Taste - avatar