This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#lang racket | |
#| | |
Little audio player to demo switching between recordings with | |
the rsound library. | |
Create two .wav files, define your constants MUSIC-DIR, SONG1, SONG2, | |
and run in DrRacket. | |
Controls: press 1 to start looping SONG1, 2 to start looping SONG2, | |
or Esc to kill the audio. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#lang racket/base | |
(require 2htdp/image | |
lang/posn | |
racket/match) | |
;; Given: I've got three colors of paint, and the wall is painted light blue. | |
(define blue (make-color #x66 #xcc #xff)) | |
(define purple (make-color #x66 #x33 #xff)) | |
(define orange (make-color #xff #xcc #x33)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#lang typed/racket/base | |
#| | |
Drawing function graphs on a circle, in modular arithmetic. | |
jmj, 8 June 2015. | |
See also: | |
http://stephanainley.com/shapes2/# | |
http://blog.recursiveprocess.com/2015/04/28/linear-modulus-art/ | |
|# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(require 2htdp/image) | |
(require 2htdp/universe) | |
; Sun and background | |
(define SPACE (rectangle 900 900 "solid" "black")) | |
(define SUN (star 20 "solid" "gold")) | |
;Key | |
; (+ [center of ellipse] (* [determines width/height of ellipse] | |
; (cos (/ fn [adjusts the speed of rotation]))))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#lang racket | |
;; Bezier curve drawing. jmj, 4/22/10. | |
;; Illustrates using posns to represent 2d locations, and drawing using 2htdp/image library. | |
;; Test cases removed. | |
(require 2htdp/image) | |
(define BG (rectangle 220 150 'solid 'white)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#lang racket | |
#| | |
Symbolic differentiation: | |
An example of higher-order functions in math. Includes: | |
* Basic function constructors: | |
- identity | |
- constant functions for several small numbers | |
- power-functions (x^n for given n) | |
* Functions of functions, or function combinators: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#lang racket | |
#| Generator for times-table images for modular arithmetic. | |
jmj (jjohnson@kirby.org), 12 Nov 2013 | |
Based on a discussion at the Monterey Bay Area Math Teachers' Circle. | |
|# | |
(require 2htdp/image) |