Christian Kellermann avatar Christian Kellermann committed a5a77ef

Move example to an examples directory.

Comments (0)

Files changed (2)

example.scm

-(use matchable doodle)
-
-(define *paint* #f)
-
-(define red '(1 0 0 0.3))
-
-(world-inits
- (lambda ()
-   (clear-screen)
-   (set-font! "Vollkorn" 18 red)
-   (text (/ doodle-width 2)
-         (/ doodle-height 2) '("Welcome to doodle!"
-                               "Click the left mouse button to draw circles"
-                               "Press ESC to leave")
-         align: #:center)))
-
-(world-changes
- (lambda (events dt exit)
-   (for-each
-    (lambda (e)
-      (match e
-       (('mouse 'pressed x y 1)
-        (set! *paint* #t)
-        (filled-circle x y 10 red))
-       (('mouse 'released x y 1)
-        (set! *paint* #f))
-       (('mouse 'moved x y)
-        (when *paint*
-          (filled-circle x y 10 red)))
-       (('key 'pressed #\esc)
-        (exit #t))
-       (else (void))))
-    events)))
-
-(new-doodle title: "Doodle paint" background: solid-white)
-(run-event-loop)

examples/circles.scm

+(use matchable doodle)
+
+(define *paint* #f)
+
+(define red '(1 0 0 0.3))
+
+(world-inits
+ (lambda ()
+   (clear-screen)
+   (set-font! "Vollkorn" 18 red)
+   (text (/ doodle-width 2)
+         (/ doodle-height 2) '("Welcome to doodle!"
+                               "Click the left mouse button to draw circles"
+                               "Press ESC to leave")
+         align: #:center)))
+
+(world-changes
+ (lambda (events dt exit)
+   (for-each
+    (lambda (e)
+      (match e
+       (('mouse 'pressed x y 1)
+        (set! *paint* #t)
+        (filled-circle x y 10 red))
+       (('mouse 'released x y 1)
+        (set! *paint* #f))
+       (('mouse 'moved x y)
+        (when *paint*
+          (filled-circle x y 10 red)))
+       (('key 'pressed #\esc)
+        (exit #t))
+       (else (void))))
+    events)))
+
+(new-doodle title: "Doodle paint" background: solid-white)
+(run-event-loop)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.