PasteRack.org
Paste # 55899
2018-09-30 10:27:52

Forked from paste # 19068.

Fork as a new paste.

Paste viewed 1234 times.


Embed:

  1. #lang scheme
  2.  
  3. (define (ToNavyTime hour ampm) (cond
  4.                                 ((= ampm 0) hour)
  5.                                 ((= ampm 1) (+ hour 12))
  6.                                 ((and (= ampm 0) (= hour 12)) 0)
  7.                                 ((and (= ampm 1) (= hour 12)) 12)
  8.                                 )
  9.   )
  10.  
  11. (ToNavyTime 3 0)
  12. (ToNavyTime 3 1)
  13. (ToNavyTime 12 0)
  14. (ToNavyTime 12 1)
  15. (ToNavyTime 5 0)
  16. (ToNavyTime 5 1)

=>

3

15

12

24

5

17