# HG changeset patch # User Robert Lowry # Date 1303134849 18000 # Node ID 5227172ed42744529ed5431a197188c9ae1f70e1 # Parent b9a9a3f9dfefb4ab122ba1d5983b053f98dc0460 added fluxus config info and euler/006 diff --git a/config/fluxus.slackware.deps b/config/fluxus.slackware.deps new file mode 100644 --- /dev/null +++ b/config/fluxus.slackware.deps @@ -0,0 +1,15 @@ +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 diff --git a/euler/006-squareofsums.scm b/euler/006-squareofsums.scm new file mode 100644 --- /dev/null +++ b/euler/006-squareofsums.scm @@ -0,0 +1,16 @@ +; 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)