<html><head><base href="x-msg://1444/"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div>#lang racket</div><div><br></div><div>(require rackunit)</div><div><br></div><div>;; [List X Y Z] -> [List Z Y X]</div><div>;; switch items one and three in a 3-element list </div><div><br></div><div>(module+ test </div><div> (check-equal? (switch-one-and-three1 '(a b c)) '(c b a))</div><div> (check-equal? (switch-one-and-three1 '(1 2 3)) '(3 2 1)))</div><div><br></div><div>(define (switch-one-and-three1 ls)</div><div> (match ls</div><div> [`(,one ,two ,three) `(,three ,two ,one)]))</div><div><br></div><div>That's 50$ -- Matthias</div></div><div><br></div><br><div><div>On Sep 5, 2012, at 2:26 PM, Ashley Fowler wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div fpstyle="1" ocsi="0"><div style="direction: ltr; font-family: Tahoma; color: rgb(0, 0, 0); font-size: 10pt; "><span style="widows: 2; text-transform: none; text-indent: 0px; letter-spacing: normal; display: inline !important; font: normal normal normal 13px/normal Tahoma; white-space: normal; orphans: 2; float: none; color: rgb(0, 0, 0); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; ">Can anybody help me with this problem? I have an idea but would like some suggestions on how to start. The problem is below...</span><div style="widows: 2; text-transform: none; text-indent: 0px; letter-spacing: normal; font: normal normal normal 13px/normal Tahoma; white-space: normal; orphans: 2; color: rgb(0, 0, 0); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><br></div><div style="widows: 2; text-transform: none; text-indent: 0px; letter-spacing: normal; font: normal normal normal 13px/normal Tahoma; white-space: normal; orphans: 2; color: rgb(0, 0, 0); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><pre style="word-wrap: break-word; white-space: pre-wrap; "><b>Write a procedure (switch-one-and-three1 LS) that takes a list of
exactly three items as its argument and returns the list with the first
and third items switched around. You may assume the input list contains
exactly three items</b></pre></div></div>____________________<br> Racket Users list:<br> <a href="http://lists.racket-lang.org/users">http://lists.racket-lang.org/users</a><br></div></blockquote></div><br></body></html>