PasteRack.org
Paste # 40076
2018-09-30 10:29:19

Forked from paste # 55899.

Fork as a new paste.

Paste viewed 2891 times.


Embed:

  1. #lang scheme
  2.  
  3. (define (ToNavyTime hour ampm) (cond
  4.                                 ((and (= ampm 1) (= hour 12)) 12)
  5.                                 ((and (= ampm 0) (= hour 12)) 0)
  6.                                 ((= ampm 0) hour)
  7.                                 ((= ampm 1) (+ hour 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

0

12

5

17