Skip to content

Instantly share code, notes, and snippets.

{
"sermons": [
{
"title": "Acceptable Worship, Part 1",
"url": "https://cdn.gty.org/sermons/High/81-64.mp3?x-source=website&x-type=download"
},
{
"title": "Acceptable Worship, Part 2",
"url": "https://cdn.gty.org/sermons/High/81-65.mp3?x-source=website&x-type=download"
},
;; TEAM BYTE ME
;; int list -> list
;; takes a list and a number and returns a list with the length of the number
(define (create_list l n)
(cond
[(= n 0) empty ]
[else (cons (first l) (create_list (rest l) (sub1 n)))
]))
@MattS8
MattS8 / in-area-event
Created November 19, 2013 00:41
Updated file and replaced the old (meh st x y ev) function
world x y ev -> world
;; adds a sound to world if not already in the world
(define (meh st x y ev)
(cond [(string=? ev "button-down")
(cond ;[(in-tone-button x y (length INSTRUMENT BOXES)) (determine-tone-button x y)]
[(in-area-event x y ERASER_CENTER_X ERASER_CENTER_Y (image-width ERASER) (image-height ERASER)) (make-world empty START-IMG)]
[(in-area-event x y CANVAS_CENTER_X CANVAS_CENTER_Y CANVAS_SIZE CANVAS_SIZE) (make-world (addSound (world-lon st) (- x (- CANVAS_CENTER_X (/ CANVAS_SIZE 2))) (- y (- CANVAS_CENTER_Y (/ CANVAS_SIZE 2)))) (addImage (world-bg st) x y))]
[else st])]
[(and (string=? ev "drag")(in-area-event x y CANVAS_CENTER_X CANVAS_CENTER_Y CANVAS_SIZE CANVAS_SIZE))
(make-world (addSound (world-lon st) (- x (- CANVAS_CENTER_X (/ CANVAS_SIZE 2))) (- y (- CANVAS_CENTER_Y (/ CANVAS_SIZE 2)))) (addImage (world-bg st) x y))]