Skip to content

Commit

Permalink
Did q1
Browse files Browse the repository at this point in the history
  • Loading branch information
jbrennan committed Nov 17, 2011
1 parent eefcfc9 commit c434e4e
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 0 deletions.
Binary file modified .DS_Store
Binary file not shown.
Binary file added a2.zip
Binary file not shown.
Binary file modified a2/.DS_Store
Binary file not shown.
13 changes: 13 additions & 0 deletions a3/q1.rkt
@@ -0,0 +1,13 @@
#lang racket

(define (position at lis)
(define (p-iter lisn count)
(cond ((eq? lisn '()) 0)
((eq? (car lisn) at) (+ 1 count))
(else (p-iter (cdr lisn) (+ 1 count)))))

(p-iter lis 0))

(position 1 '(2 3 1 4))
(position 'a '(b b c a b a))
(position 'a '(b c))
2 changes: 2 additions & 0 deletions a3/q1.rkt~
@@ -0,0 +1,2 @@
#lang racket

0 comments on commit c434e4e

Please sign in to comment.