Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- *****************************************************************
- * * Author: Sezen
- * * Date: 7/14/21
- * * Will update as I learn more SNOBOL4. BASE6 is messy, a branch wasn't working.
- *******************************************************************
- * * OUTPUTS:
- * * STANDARD TIME: 15:55:15
- * * EMILY TIME: 35:51:42
- *************************************************************************
- * * MORE ON EMILY TIME:
- * * http://xahlee.info/kbd/happy_hacking_emily.html
- *****************************************************************
- *
- MAIN
- *
- DEFINE('BASE6(T)NUM') :(BASE6_END)
- BASE6
- EQ(REMDR(T,6),0) :S(ENDF)
- NUM = (REMDR(T,6)) NUM
- T = T / 6 :(BASE6)
- ENDF
- EQ(SIZE(NUM),1) :S(ADD0)F(END1)
- ADD0 NUM = 0 NUM
- END1 NUM LEN(0) LEN(2) . BASE6 :(RETURN)
- BASE6_END
- *
- OUTPUT = "ENTER A TIME: "
- DATE1 = INPUT
- DATE1 LEN(0) LEN(2) . CHOUR
- DATE1 LEN(3) LEN(2) . CMIN
- DATE1 LEN(6) LEN(2) . CSEC
- HTEST GE(CHOUR,00) LE(CHOUR,23) :S(MTEST)F(FAIL)
- MTEST GE(CMIN,00) LE(CMIN,59) :S(STEST)F(FAIL)
- STEST GE(CSEC,00) LE(CSEC,59) :S(GO)F(FAIL)
- GO SECS = ((CHOUR * 60) * 60) + (CMIN * 60) + CSEC
- DPER = SECS / 86400.0
- ETOTAL = CONVERT(DPER * 46656.0,"INTEGER")
- EH = CONVERT(ETOTAL / (36.0 * 36.0),"INTEGER")
- EM = CONVERT((ETOTAL - (EH * (36.0 * 36.0))) / 36.0,"INTEGER")
- ES = REMDR(ETOTAL,36)
- OUTPUT = "STANDARD TIME: " DATE1
- OUTPUT = "EMILY TIME: " BASE6(EH) ":" BASE6(EM) ":" BASE6(ES) :(END)
- FAIL OUTPUT = "BAD TIME, TRY AGAIN!" :(MAIN)
- *
- END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement