Discussion On
Learning Scala With Project Euler

by in Programming Languages


  1. Jess Johnson
    Tuesday, September 1636, 2008

    I found a few other sites out there that are writing about Scala and Project Euler:
    Dianne Marsh’s Blog
    Memetic Musings
    Blok Blogs

  2. Pak Tam
    Sunday, September 2850, 2008

    Nice. Thanks. :) Pak Tam

  3. Jim H
    Monday, September 2901, 2008

    How does this filter out the multiples of 15? Does FoldLeft remove duplicates?

    (1 until 1000).filter(n => n % 3 == 0 || n % 5 == 0).foldLeft(0)(_ + _)

  4. Jess Johnson
    Monday, September 2914, 2008

    @Jim H In that case we don’t need to subtract the multiples of 15 because they aren’t counted twice like they were in the first example. When foldLeft operates on the range, there is only one instance of 15 in the range.

  5. G
    Tuesday, November 444, 2008

    Scala seems like messy Python. I probably need to look into it more though


Leave a Reply