aboutsummaryrefslogtreecommitdiffstats
path: root/grtest.scm
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2017-03-03 00:56:40 -0800
committerBryan Newbold <bnewbold@robocracy.org>2017-08-02 00:09:46 -0700
commit879f4fa041cfdefee655eb877f1a91f86a9c62b7 (patch)
treebc68ac058e5d0a7cf8e7815cbe1070fd60e75589 /grtest.scm
parentd13fcf5c0bd68f67059b2561c28c40b55e1117a3 (diff)
downloadscm-879f4fa041cfdefee655eb877f1a91f86a9c62b7.tar.gz
scm-879f4fa041cfdefee655eb877f1a91f86a9c62b7.zip
New upstream version 5f2
Diffstat (limited to 'grtest.scm')
-rw-r--r--grtest.scm82
1 files changed, 0 insertions, 82 deletions
diff --git a/grtest.scm b/grtest.scm
deleted file mode 100644
index 7401308..0000000
--- a/grtest.scm
+++ /dev/null
@@ -1,82 +0,0 @@
-
-; This is a quick hack to test the graphics primitives.
-; The SLIB scheme library is needed for random.
-; IMHO, the syntax of `do' in scheme is horrible!
-; - sjm
-
-(define (grtest)
- (require 'random) ; needs SLIB
- (graphics-mode!)
-
- (display "testing draw-to") (newline)
- (clear-graphics!)
- (goto-center!)
- (do ((x 0 (+ x 3)))
- ((> x (max-x)) 0)
- (set-color! (remainder (/ x 3) (max-color)))
- (draw-to x 0)
- (draw-to x (max-y))
- )
-
- (do ((y 0 (+ y 3)))
- ((> y (max-y)) 0)
- (set-color! (remainder (/ y 3) (max-color)))
- (goto-center!)
- (draw-to! 0 y)
- (goto-center!)
- (draw-to! (max-x) y)
- )
-
- (goto-nw!)
- (do ((x 0 (+ x 2)))
- ((> x (max-x)) 0)
- (set-color! (remainder (/ x 2) (max-color)))
- (draw-to x (max-y))
- )
- (do ((y (+ (max-y) 1) (- y 2)))
- ((< y 0) 0)
- (set-color! (remainder (/ y 2) (max-color)))
- (draw-to (max-x) y)
- )
-
- (display "testing set-dot!") (newline)
- (clear-graphics!)
- (do ((x 0 (+ x 1)))
- ((= x 100) 0)
- (set-dot! (+ (random (max-x)) 1) (+ (random (max-y)) 1)
- (+ (random (max-color)) 1))
- )
-
- (display "testing draw with turn-to!") (newline)
- (clear-graphics!)
- (goto-center!)
- (do ((x 0 (+ x 1)))
- ((= x 100) 0)
- (set-color! (+ (random (max-color)) 1))
- (turn-to! (random 360))
- (draw (random 50))
- )
-
- (display "testing draw with turn-right") (newline)
- (clear-graphics!)
- (goto-center!)
- (do ((x 0 (+ x 1)))
- ((= x 100) 0)
- (set-color! (+ (random (max-color)) 1))
- (turn-right (random 90))
- (draw (random 50))
- )
-
- (display "testing draw with turn-left") (newline)
- (clear-graphics!)
- (goto-center!)
- (do ((x 0 (+ x 1)))
- ((= x 100) 0)
- (set-color! (+ (random (max-color)) 1))
- (turn-left (random 90))
- (draw (random 50))
- )
-
- (text-mode!)
-)
-