fork download
  1. ; boxing the compass
  2.  
  3. (define (compass d)
  4. (define compass-points
  5. '#(N NNE NE ENE E ESE SE SSE
  6. S SSW SW WSW W WNW NW NNW))
  7. (vector-ref compass-points
  8. (modulo (inexact->exact (floor (/ (+ d 11.25) 22.5))) 16)))
  9.  
  10. (display (compass 70)) (newline)
  11. (display (compass 230)) (newline)
Success #stdin #stdout 0.01s 50224KB
stdin
Standard input is empty
stdout
ENE
SW