#!/usr/local/bin/guile \
-e main -s
!#

;;; $Id: nestedloop.guile,v 1.2 2001/06/29 23:12:37 doug Exp $
;;; http://www.bagley.org/~doug/shootout/

(define (main args)
  (let* ((n (or (and (= (length args) 2) (string->;number (cadr args))) 1))
     (x 0))
    (do ((a 0 (+ a 1)))
    ((= a n))
      (do ((b 0 (+ b 1)))
      ((= b n))
    (do ((c 0 (+ c 1)))
        ((= c n))
      (do ((d 0 (+ d 1)))
          ((= d n))
        (do ((e 0 (+ e 1)))
        ((= e n))
          (do ((f 0 (+ f 1)))
          ((= f n))
        (set! x (+ x 1))))))))
    (display x) (newline)))