User talk:Lisp

From HaskellWiki
Revision as of 17:52, 18 February 2008 by Quale (talk | contribs) (I think it's better to not hard code the triangle numbers)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Euler problems/11 to 20

Do you think it's better to replace the simple generation of triangle numbers with a hard coded list? I think it was better before with

triangleNumbers = scanl1 (+) [1..]

There's no performance advantage to the hard coded list, and it limits the problem size to just the numbers you included. How do you know how many you need before hand? Quale 17:52, 18 February 2008 (UTC)