Problem 11 of #ProjectEuler100 solved. Real fast times for Swift and Lua. https://github.com/downie/project-euler/tree/master/011 …
This one was a bit tedious to write, but at least it ran quickly.
-
Prikaži ovu nit
-
Problem 12 of
#ProjectEuler100 solved! https://github.com/downie/project-euler/tree/master/012 … The Swift solution runs in 0.4s vs Lua’s almost 2s. For the same style approach.1 reply 1 proslijeđeni tweet 4 korisnika označavaju da im se sviđaPrikaži ovu nit -
Problem 13 of
#ProjectEuler100 solved: https://github.com/downie/project-euler/tree/master/013 … Swift & Lua seem to handle large numbers well, so the obvious approach solved it almost instantly in both languages.1 proslijeđeni tweet 5 korisnika označava da im se sviđaPrikaži ovu nit -
Problem 14 of
#ProjectEuler100 solved in Lua & Swift. https://github.com/downie/project-euler/tree/master/014 … Memoization was a huge performance gain, even more so than Lua’s optimized tail recursion. It took Lua’s runtime from ~17s to 1s, and Swift’s from ~5s to 2s.1 reply 1 proslijeđeni tweet 3 korisnika označavaju da im se sviđaPrikaži ovu nit -
Problem 15 of
#ProjectEuler100 solved in Lua & Swift: https://github.com/downie/project-euler/tree/master/015 … Tree traversal took waaaay too long. I had to figure out a math-y way to solve it. Runs instantly in Lua, and in 2ms for Swift.1 reply 1 proslijeđeni tweet 2 korisnika označavaju da im se sviđaPrikaži ovu nit -
Problem 16 of
#ProjectEuler100 solved in Swift & Lua. https://github.com/downie/project-euler/tree/master/016 … Another quick runtime since both languages handle big numbers well.1 reply 1 proslijeđeni tweet 1 korisnik označava da mu se sviđaPrikaži ovu nit -
Problem 17 of
#ProjectEuler100 solved, in Lua & Swift. https://github.com/downie/project-euler/tree/master/017 … This wasn’t hard, just annoying. I did like the readability of both `#”and”` and `”and”.count` rather than hard-coding some string lengths.1 reply 1 proslijeđeni tweet 1 korisnik označava da mu se sviđaPrikaži ovu nit -
Problem 18 of
#ProjectEuler100 solved in Swift & Lua: https://github.com/downie/project-euler/tree/master/018 … I totally overcomplicated this for myself by trying an A* search. Ended up with a simpler solution. I really shouldn’t try to optimize things until I have a perf issue.1 reply 1 proslijeđeni tweet 5 korisnika označava da im se sviđaPrikaži ovu nit -
Problem 19 of
#ProjectEuler100 solved in Swift and Lua. I found my first novel use of pattern matching with Swift on this one.1 proslijeđeni tweet 5 korisnika označava da im se sviđaPrikaži ovu nit -
Problem 20 of
#ProjectEuler100 solved in Swift (182ms) and Lua (31ms). Neither language had enough precision, so I had to implement my own BigInt type. Kinda surprising there isn’t a BigInt in Swift already. Not surprised by Lua.1 reply 1 proslijeđeni tweet 7 korisnika označava da im se sviđaPrikaži ovu nit
Problem 21 of #ProjectEuler100 solved. Lua solves in 1.2s, Swift an _order of magnitude_ slower at 22.7s. https://github.com/downie/project-euler/tree/master/021 …
I could probably spend more time making my divisors method faster, but I’m ready to move on. I spent way too long misunderstanding this problem.
-
-
Problem 22 of
#ProjectEuler100 solved in Lua (9ms) and Swift (50ms). https://github.com/downie/project-euler/tree/master/022 …
Both languages have fast enough built-in sorts so this was pretty easy.
My Swift solution stumbled upon a nasty compiler bug. Reported as FB7561652.1 reply 1 proslijeđeni tweet 2 korisnika označavaju da im se sviđaPrikaži ovu nit -
Problem 23 of
#ProjectEuler100 solved. Lua runs in 5.6s, Swift in 1.8 https://github.com/downie/project-euler/tree/master/023 … I realized I’ve been benchmarking my Swift solutions with debug builds. The release builds run so much faster without any other effort. Way to go, compiler.0 replies 1 proslijeđeni tweet 0 korisnika označava da im se sviđaPrikaži ovu nit
Kraj razgovora
Novi razgovor -
Čini se da učitavanje traje već neko vrijeme.
Twitter je možda preopterećen ili ima kratkotrajnih poteškoća u radu. Pokušajte ponovno ili potražite dodatne informacije u odjeljku Status Twittera.