a thoughtful web.
Good ideas and conversation. No ads, no tracking.   Login or Take a Tour!
comment
wasoxygen  ·  4032 days ago  ·  link  ·    ·  parent  ·  post: What language(s) are you currently learning?

Thank you very much for this suggestion. I have been wanting to try functional programming for a long time, after seeing so many inscrutable and concise solutions on Project Euler. I never managed to get far with Haskell, though.

In addition to the web version you linked to, Chris Krycho has created a nicely-formatted Kindle version. I am 4% through it and managed to write my first Scheme code for Exercise 1.3: "Define a procedure that takes three numbers as arguments and returns the sum of the squares of the two larger numbers."

  (define (square a) ( * a a))
  (define (sumofsquares a b) (+ (square a) (square b)))
  (define (<= a b) (or (< a b) (= a b)) )
  (define (sosbig2 a b c) 
    (cond 
      ( (and (<= a b) (<= a c)) (sumofsquares b c))
      ( (and (<= b a) (<= b c)) (sumofsquares a c))
      ( (and (<= c a) (<= c b)) (sumofsquares a b))))
I am using a handy online interpreter.

delta, how's your progress coming?