#! /usr/bin/env racket #lang racket (module+ main (displayln total-cost)) ;; TODO: describe in detail what each field is (struct item (description quantity unit-cost max-lead-days where-to-get note)) (define (make-item description quantity unit-cost max-lead-days where-to-get [note ""]) (item description quantity unit-cost max-lead-days where-to-get note)) (define bill-of-materials (list ;; TODO: add solid core wires ;; TODO: add male-female jump wires for connecting sonar sensors ;; TODO: add 4x AA batteries ;; TODO: add 4x AA battery holder ;; TODO: add 3d printer filament cost for wheel, sonar sensor holders, ;; caster standoff ;; TODO: add ball caster ;; TODO: add angle bracket from evil mad science (make-item "Arduino(tm) board" 1 16.98 8 (string-append "http://www.colorapples.com/2012-new-arduino-uno-r3-board" "-atmega328-with-usb-cable-p-89818.html#.U3Lz5nJKyzA") "comes with USB A to B cable") (make-item "motor" 2 6 7 "https://solarbotics.com/product/gm3/") (make-item "transparent 400 point (half) BreadBoard" 1 5.95 1 (string-append "http://www.jameco.com/webapp/wcs/stores/servlet/" "Product_10001_10001_2123830_-1")) (make-item "jumper wire female/male" 1/5 6 2 (string-append "http://www.nexuscyber.com/" "7-premium-40-pin-male-to-female-jumper-wires")) (make-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/")) ;; TODO: get actual cost of #4-40 phillips 1&1/4" screws (make-item "#4-40 Phillips 1 1/4 inch screws" 3 .1 1 "olander" "price is an estimate. can pick up in person") ;; TODO: get actual cost of #4-40 hex lock nuts (make-item "#4-40 hex lock nuts" 6 .1 1 "olander" "price is an estimate. can pick up in person") ;; TODO: get actual cost of #6-32 3/8" screws (make-item "#6-32 button hex head socket 3/8 inch" 12 .1 1 "olander" "price is an estimate. can pick up in person") (make-item "motor controller" 1 (/ 5.2 5) 10 "http://www.ebay.com/itm/like/180976411359?lpid=82") (make-item "sonar sensor hc-sr04" 2 1.39 7 "http://www.ebay.com/itm/161156018270"))) (define total-cost (apply + (for/list ([thing bill-of-materials]) (* (item-quantity thing) (item-unit-cost thing)))))