title: Converting Racket code so that it uses only one Cond
body: <p><em>This code has many cond used in it I have to convert this code and use cond only once, which I am unable to do.</em></p>
  
  <p><code>(define (q1a x) 
   (cond 
     [(p1? x) 
      (cond 
         [(p2? x) ’down] 
         [else ’up])] 
   [else 
     (cond [(p2? x) ’left] 
     [else ’right])]))</code></p>
  
  <p><strong>After converting the code in which I have to use cond function only once but i can use and, or I am getting this error 
  Here is the error : expected a clause with a question and an answer, but found a clause with 3 parts</strong></p>
  
  <pre><code>    (define (qla x)
        (cond[(p1? x)(p2? x)'down]
         [(else 'up)]
         [(or[(p2? x)'left]
         [else 'right])]))
  </code></pre>