↳
In-reply-to
»
It is such a nice feeling that Mu is such a capable little language š
And I decided to write code code in Mu by hand š¤ haha 𤣠and start solving Project Euler problems, like Problem 8 which works out to be a nice elegant solution in Mu:
⤠Read More
And just like that Problem 10 is done and correct whoohoo š„³ It was easy because in Problem 7 Iād already written an iterator to produce infinite primes. So the solution for finding the sum of primes under 2,000,000 is basically (shortened):
primes := iter.take_while(iter.filter(prime_candidates(), is_prime), fn(p) { p < n })
print(iter.sum(primes))
And of course the answer is: 142913828922 which took ~21.ss for the Go Vm to compuete.