Timeline for Project Euler 8: Largest product in a series in Functional Programming (FP)
Current License: CC BY-SA 3.0
8 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Jan 5, 2018 at 13:37 | vote | accept | thadeuszlay | ||
| Jan 5, 2018 at 11:29 | comment | added | thadeuszlay | For those downvoting this question: Please provide an explanation so I don't repeat the mistake twice. | |
| Jan 4, 2018 at 22:29 | comment | added | le_m | The products of 13 digits are still within the range where you can perform integer division without having to worry about precision errors. So a less complex solution would probably find those products by iterating through all digits only once, multiplying with the next digit and dividing by the digit seen 13 iterations ago. You could squeeze this into a reduce accumulator, but I'd probably write a generator function for that and a function max(iterable). | |
| Jan 4, 2018 at 22:04 | comment | added | le_m | Instead of (function() {})()you could use a simple block {}. | |
| Jan 4, 2018 at 21:47 | answer | added | tokland | timeline score: 1 | |
| Jan 4, 2018 at 20:16 | comment | added | thadeuszlay | SIZE and INPUT are capital letters because they stay the same at every iteration. Others are functions. And others are indeed constant-variables, but different ones - newly created at every recursion. This is the distinction I wanted to make between const with capital letters and const with standard letters. @Carles Alcolea | |
| Jan 4, 2018 at 19:59 | comment | added | Neithan Max | I have nothing for the FP aspect of it, but the style is inconsistent. Some const are, according to standards, all uppercase, but the rest are not. | |
| Jan 4, 2018 at 19:38 | history | asked | thadeuszlay | CC BY-SA 3.0 |