From 845aa5f98e85450f1cec5177837654898b1db4e6 Mon Sep 17 00:00:00 2001 From: daniel watson Date: Wed, 4 Sep 2013 18:53:24 -0700 Subject: [PATCH] add bill of materials --- bill-of-materials.rkt | 46 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100755 bill-of-materials.rkt diff --git a/bill-of-materials.rkt b/bill-of-materials.rkt new file mode 100755 index 0000000..a5af034 --- /dev/null +++ b/bill-of-materials.rkt @@ -0,0 +1,46 @@ +#! /usr/bin/env racket +#lang racket + +(module+ main + (displayln total-cost)) + +(struct item (description quantity unit-cost max-lead-days where-to-get)) + +(define bill-of-materials + (list + (item "Arduino(tm) board" + 1 21 8 (string-append "http://store.mp3car.com/" + "Genuine_Arduino_Uno_R3_SMD_p/OPN-013B.htm" + "?gclid=CKizyYOKsrkCFap7Qgod9kgAOQ")) + (item "USB a to b" 1 4 7 "https://www.sparkfun.com/products/512") + (item "wheel" 2 3 7 "http://www.pololu.com/catalog/product/184") + (item "motor" 2 6 7 "http://www.pololu.com/catalog/product/181") + (item "half BreadBoard" 1 5 3 "http://www.adafruit.com/products/64") + (item "jumper wire male/male assorted lengths" + 1 6 3 "http://www.adafruit.com/products/153") + (item "jumper wire female/male" 1/5 6 2 + (string-append "http://www.nexuscyber.com/" + "7-premium-40-pin-male-to-female-jumper-wires")) + (item "small squares of double sided tape" + 1/30 12 1 + (string-append + "http://www.officedepot.com/" + "a/products/495242/Scotch-Permanent-Double-Sided-Foam-Tape/")) + (item "#4-40 Phillips 1/2 inch flat-head screws" + 3 .1 1 "home depot, lowes") + (item "#4-40 hex nuts" + 6 .1 1 "home depot, lowes") + (item "#4 lock washers" + 3 .1 1 "home depot, lowes") + (item "Red LEDs" + 2 .1 1 "evil mad science?") + (item "Yellow LEDs" + 2 .1 1 "evil mad science?") + (item "Green LEDs" + 2 .1 1 "evil mad science?") + (item "330 Ohm Resistors" + 6 .1 1 "evil mad science?"))) + +(define total-cost + (apply + (for/list ([thing bill-of-materials]) + (* (item-quantity thing) (item-unit-cost thing))))) -- 2.30.2