summaryrefslogtreecommitdiffstats
path: root/grtest.scm
diff options
context:
space:
mode:
authorThomas Bushnell <tb@debian.org>2006-04-26 23:01:39 -0700
committerBryan Newbold <bnewbold@robocracy.org>2017-02-20 00:05:32 -0800
commit20402610bf881f67b22eb1600340d8284556ae56 (patch)
tree6a19e5a1b2cc22dccd1003787a70b751f7da4763 /grtest.scm
parent5846f77421a975897a31d6fbf3f520aab385cea3 (diff)
parentae2b295c7deaf2d7c18ad1ed9b6050970e56bae7 (diff)
downloadscm-20402610bf881f67b22eb1600340d8284556ae56.tar.gz
scm-20402610bf881f67b22eb1600340d8284556ae56.zip
Import Debian changes 5e2-1debian/5e2-1
scm (5e2-1) unstable; urgency=low * New upstream release. * Change to continue.h from version 5e1-2 repeated here.
Diffstat (limited to 'grtest.scm')
-rw-r--r--grtest.scm82
1 files changed, 82 insertions, 0 deletions
diff --git a/grtest.scm b/grtest.scm
new file mode 100644
index 0000000..7401308
--- /dev/null
+++ b/grtest.scm
@@ -0,0 +1,82 @@
+
+; 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!)
+)
+