Commits

Robert Lowry committed 5227172

added fluxus config info and euler/006

  • Participants
  • Parent commits b9a9a3f

Comments (0)

Files changed (2)

config/fluxus.slackware.deps

+met:
+fftw
+glew
+libfreetype
+libalsa
+
+sbo:
+libsndfile
+ode
+jack
+liblo
+openal
+
+manual:
+plt-scheme (configure --enable-shared) http://download.plt-scheme.org/bundles/4.2.2/plt/plt-4.2.2-src-unix.tgz

euler/006-squareofsums.scm

+; project euler problem 6
+; find the difference between the sum of squares and the square of the sums of
+; all integers from 1 to 100
+
+(define (sum f a b)
+	(if (> a b) 0
+		(+ (f a) (sum f (+ a 1) b))))
+(define (ident x) x) 
+(define (square x) (* x x))
+(define (abs x) (if (< x 0) (- x) x))
+(define (difference x, y) (abs (- x y)))
+(define (sum-of-squares a b) (sum square a b))
+(define (square-of-sums a b) (square (sum ident a b)))
+
+(display (difference (sum-of-squares 1 100) (square-of-sums 1 100)))
+(newline)