์ด๊ฒ์ ๋งค์ฐ ๊ฐ๋จํ ๋์ ์ด์ง๋ง ์ฌ๋ฏธ์๋ ์ผ์ ๋๋ค.
์ง๋ฌด
ํ์ฌ ๋ฌ 4
๊ณผ ์์ผ์ด 20
์๊ฐ (12 ์๊ฐ ์๊ณ ๊ธฐ์ค) 4
์ด๊ณ ๋ถ์ด ์๊ฐ 20
์ด๊ฑฐ๋ ๋ถ์ด 4
2 20
์ด์ธ ๊ฒฝ์ฐ์ด ์์คํค ์ํธ๋ฅผ ์ธ์ํ์ญ์์ค.
.
.:.
:|:
.:|:.
::|::
:. ::|:: .:
:|:. .::|::. .:|:
::|:. :::|::: .:|:;
`::|:. :::|::: .:|::'
::|::. :::|::: .::|:;
`::|::. :::|::: .::|::'
:::|::. :::|::: .::|::;
`:::|::. :::|::: .::|::;'
`::. `:::|::. :::|::: .::|::;' .:;'
`:::.. `;::|::. :::|::: .::|::: ::::;
`:::::. ':|::. :::|::: .::|:' ,::::;'
`:::::. ':|:::::|:::::|:' :::::;'
`:::::.:::::|::::|::::|::::.,:::;'
':::::::::|:::|:::|:::::::;:'
':::::::|::|::|:::::::''
`::::::::::;'
.:;'' ::: ``::.
:':':
;
ํํ ๊ณต๋ฐฑ์ด์์ ์ ์์ต๋๋ค.
๊ทธ๋ ์ง ์์ผ๋ฉด ๋ค์๊ณผ ๊ฐ์ ๊ฒฝ์ฐ๊น์ง ๋จ์ ์๊ฐ (๋ถ ๋ฐ ์ด)์ ๋ค์๊ณผ ๊ฐ์ ํ์์ผ๋ก ์ธ์ํ์ญ์์ค %d minutes and %d seconds left until your next hit.
.
์ด๊ฒ์ code-golf ์ด๋ฏ๋ก ๋ฐ์ดํธ ๋จ์์ ๊ฐ์ฅ ์งง์ ์ฝ๋๊ฐ ์ด๊น๋๋ค!
์ถ์ ์ด ๋์ ์ด์ด ์ฌ์ดํธ์ ๋๋ฌด ๋ถ์ ์ ํ๋ค๋ฉด, ์ ์๊ฒ ์๋ ค ์ฃผ์๋ฉด ๋ณ๊ฒฝํ๊ฒ ์ต๋๋ค.
๋ต๋ณ
ํ์ด์ฌ 2, 371 ๋ฐ์ดํธ
์ด ์์ค๋ ์ธ์ ํ ์์๋ ๋ฐ์ดํธ๋ฅผ ํฌํจํ๋ฏ๋ก๋ก ๋์ฝ๋ฉ ํ ์์๋ 16 ์ง ๋คํ๋ก ํ์๋ฉ๋๋ค xxd -r
.
00000000: efbb bf66 726f 6d20 7469 6d65 2069 6d70 ...from time imp
00000010: 6f72 742a 0a74 3d74 696d 6528 290a 693d ort*.t=time().i=
00000020: 300a 7768 696c 6527 3034 3a32 3027 6e6f 0.while'04:20'no
00000030: 7420 696e 2073 7472 6674 696d 6528 2725 t in strftime('%
00000040: 6d3a 2564 2572 272c 6c6f 6361 6c74 696d m:%d%r',localtim
00000050: 6528 742b 6929 293a 692b 3d31 0a70 7269 e(t+i)):i+=1.pri
00000060: 6e74 5b22 7801 74cd c701 c430 0844 d1bb nt["x.t....0.D..
00000070: aaf0 cd99 0286 6654 887a dfa0 f41d 7136 ......fT.z....q6
00000080: 8f61 7829 0b6f 5c72 bdb6 9414 de86 d2eb .ax).o\r........
00000090: 9894 d4e7 64f7 de39 099a 8ed8 32b5 d34a ....d..9....2..J
000000a0: e8c9 2a53 9da4 371a b1d0 a3d4 18e8 b212 ..*S..7.........
000000b0: 5a25 a139 158a ac90 4cba 7692 4007 c62e Z%.9....L.v.@...
000000c0: 81b8 31c4 9682 04e2 6ab8 8f21 3bb3 3ce1 ..1.....j..!;.<.
000000d0: 7582 0163 8524 79a8 c175 cb58 7ce5 45ff u..c.$y..u.X|.E.
000000e0: b3b7 8cc7 bfbe fbaa 9b95 b068 1837 db90 ...........h.7..
000000f0: a546 b54a 5cb9 5c38 6801 0936 a2a8 a85e .F.J\.\8h..6...^
00000100: 6ca3 4c3e 8e83 a4ef 1412 12ac 7027 7075 l.L>........p'pu
00000110: 2084 ca61 026b 5c30 286e a1fe 222e 6465 ..a.k\0(n..".de
00000120: 636f 6465 2827 7a69 7027 292c 2725 6420 code('zip'),'%d
00000130: 6d69 6e75 7465 7320 616e 6420 2564 2073 minutes and %d s
00000140: 6563 6f6e 6473 206c 6566 7420 756e 7469 econds left unti
00000150: 6c20 796f 7572 206e 6578 7420 6869 742e l your next hit.
00000160: 2725 2869 2f36 302c 6925 3630 295d 5b69 '%(i/60,i%60)][i
00000170: 3e30 5d >0]
์ฝ์ ์์๋ ๋ถ๋ถ :
from time import*
t=time()
i=0
while'04:20'not in strftime('%m:%d%r',localtime(t+i)):i+=1
print["(ZLIB DATA)".decode('zip'),'%d minutes and %d seconds left until your next hit.'%(i/60,i%60)][i>0]
๋ต๋ณ
์๋ฐ ์คํฌ๋ฆฝํธ (ES6), 537 ๋ฐ์ดํธ
alert((f=t=>new Date(Date.now()+t*1e3).toISOString().match`(T16|04)[-:]20`)(i=0)?"ร\u0019\u0002รป1!ยฐ?4\u0002รซ14!ยฐ>C3\u0002=\u0001ร34\u0003ร1\u0002=4\u00011C3\u000114\u0002=C\u0013รฐ4\u0009\u001fCS\u0002m34\u0001>Iร 14s\u0002>C3\u0001=Iร1CS\u0002n34\u0013ร4\u0009\u001c34s\u0002?I3\u0001;Iยฐ1C3%รฐ6I3\u0001:Iย 1C3ub3\u0001l4\u00134\u0009\u001934S\u0007\u001bS'`\u0011ย V34\u0013\u00004\u0009\u001034\u0009:Z\u0002iยณ\u0001zC3\u00014\u00091Cs8Z'ยฐ6\u001bย 74Kยณ4\u00079['ร6\u001bยณ4Jยฃ4\u001a8Y'ย yรณ4I4]s\u0002ร7M34Cรw\u0002ยซ6u\u00021u\u0007`6\u0013\u0002รซss#รY".replace(/./g,c=>(l=" .\n:|;`',0123456")[(n=c.charCodeAt())&15]+l[n>>4]).replace(/.\d+/g,c=>c[0].repeat(parseInt(c.slice(1),7)+3)):eval('for(;!f(++i););`${i/60|0} minutes and ${i%60|0} seconds left until your next hit.`'))
CP-1252 ์ธ์ฝ๋ฉ์ ์ฌ์ฉํฉ๋๋ค.
์ฐธ๊ณ :์ด ๊ฒ์๋ฌผ์ ๋ชจ๋ ์ฝ์ ์์๋ ํญ๋ชฉ์ ์ด์ค์ผ์ดํ ์ฒ๋ฆฌ๋์ด \u00xx
Stack Exchange ์์คํ
์์ ์๋์ผ๋ก ์ ๊ฑฐ๋์ง ์์ต๋๋ค. ํฌ๊ธฐ๋ 1 ๋ฐ์ดํธ ์ธ ๊ฒ์ผ๋ก ๊ฐ์ฃผํด์ผํฉ๋๋ค.
์ค๋ช
๊ฐ ๋ฌธ์๋ฅผ 4 ๋นํธ๋ก ์์ถํ๋ ๊ฒ๊ณผ ํจ๊ป ๊ธธ์ด ๊ธธ์ด ์ธ์ฝ๋ฉ ์ฒด๊ณ๋ฅผ ์ฌ์ฉํฉ๋๋ค. ์ฝ๋์ ์ฃผ์ ๋ ผ๋ฆฌ๋ 174 ๋ฐ์ดํธ์ด๊ณ ๋ฆฌํ ๋ฌธ์์ด (์์ถ ํด์ ํฌํจ)์ 364 ๋ฐ์ดํธ์ ๋๋ค. ์์ถ ๋ฐฉ๋ฒ์ ๋ํ ์์ธํ ๋ด์ฉ์ ์๋๋ฅผ ์ฐธ์กฐํ์ญ์์ค.
alert((
f=t=> // f checks for 4:20 in a date
new Date(Date.now()+t*1e3) // get the date at now + t seconds
.toISOString().match`(T16|04)[-:]20` // find 4:20 in the ISO date string
)(i=0)?
// Leaf decompression
"ร\u0019\u0002รป1!ยฐ?4\u0002รซ14!ยฐ>C3\u0002=\u0001ร34\u0003ร1\u0002=4\u00011C3\u000114\u0002=C\u0013รฐ4\u0009\u001fCS\u0002m34\u0001>Iร 14s\u0002>C3\u0001=Iร1CS\u0002n34\u0013ร4\u0009\u001c34s\u0002?I3\u0001;Iยฐ1C3%รฐ6I3\u0001:Iย 1C3ub3\u0001l4\u00134\u0009\u001934S\u0007\u001bS'`\u0011ย V34\u0013\u00004\u0009\u001034\u0009:Z\u0002iยณ\u0001zC3\u00014\u00091Cs8Z'ยฐ6\u001bย 74Kยณ4\u00079['ร6\u001bยณ4Jยฃ4\u001a8Y'ย yรณ4I4]s\u0002ร7M34Cรw\u0002ยซ6u\u00021u\u0007`6\u0013\u0002รซss#รY"
.replace(/./g,c=> // unpack each 4-bit character
(l=" .\n:|;`',0123456") // l = lookup table of characters
[(n=c.charCodeAt())&15]+l[n>>4] // return the two characters in the byte
)
.replace(/.\d+/g,c=> // run-length decoding
c[0].repeat(parseInt(c.slice(1),7)+3) // repeat character n + 3 times (base-7)
)
:eval(` // eval just to allow a for loop here...
for(;!f(++i);); // check each second up until a match
\`${i/60|0} minutes and ${i%60|0} seconds left until your next hit.\`
`))
์์ถ ์๊ณ ๋ฆฌ์ฆ
์์ถ ์์, 911 ๋ฐ์ดํธ
์ด๊ฒ์ ์ ํ ์์ถ๋์ง ์์ ๋ฆฌํ ๋ฌธ์์ด์ ๋๋ค.
` .
.:.
:|:
.:|:.
::|::
:. ::|:: .:
:|:. .::|::. .:|:
::|:. :::|::: .:|:;
\`::|:. :::|::: .:|::'
::|::. :::|::: .::|:;
\`::|::. :::|::: .::|::'
:::|::. :::|::: .::|::;
\`:::|::. :::|::: .::|::;'
\`::. \`:::|::. :::|::: .::|::;' .:;'
\`:::.. \`;::|::. :::|::: .::|::: ::::;
\`:::::. ':|::. :::|::: .::|:' ,::::;'
\`:::::. ':|:::::|:::::|:' :::::;'
\`:::::.:::::|::::|::::|::::.,:::;'
':::::::::|:::|:::|:::::::;:'
':::::::|::|::|:::::::''
\`::::::::::;'
.:;'' ::: \`\`::.
:':':
;`
๋ฐ ๊ธธ์ด ์ธ์ฝ๋ฉ, 542 ๋ฐ์ดํธ
๋ฐ๋ณต๋๋ ์ฐ์ ๋ ๋ฌธ์๊ฐ ๋ง์ผ๋ฏ๋ก ์คํ ๊ธธ์ด ์ธ์ฝ๋ฉ์ ๋ฐ์ดํธ ์๋ฅผ ํฌ๊ฒ ํฅ์์ํต๋๋ค.
` 21.
20.:.
20:|:
19.:|:.
19::|::
4:. 10::|:: 10.:
4:|:. 7.::|::. 7.:|:
4::|:. 6:0|:0 6.:|:;
4\`::|:. 5:0|:0 5.:|::'
5::|::. 4:0|:0 4.::|:;
5\`::|::. 3:0|:0 3.::|::'
6:0|::. 2:0|:0 2.::|::;
6\`:0|::. 1:0|:0 1.::|::;'
\`::. 3\`:0|::. 0:0|:0 0.::|::;' 2.:;'
\`:0.. 1\`;::|::. :0|:0 .::|:0 1:1;
0\`:2. 1':|::. :0|:0 .::|:' 0,:1;'
2\`:2. 1':|:2|:2|:' 0:2;'
4\`:2.:2|:1|:1|:1.,:0;'
7':6|:0|:0|:4;:'
10':4|::|::|:4''
15\`:7;'
14.:;'' :0 \`\`::.
19:':':
21;`.replace(/.\d+/g,c=>c[0].repeat(+c.slice(1)+3))
3 ํ ์ด์ ๋ฐ๋ณต ๋ ๊ฐ ๋ฌธ์๋ 10 ์ง์๋ก ์ด๋ฃจ์ด์ง ๋ฌธ์๋ก ๋์ฒด๋ฉ๋๋ค amount - 3
. ์ธ์ฝ๋ฉ ๋ ๋ฌธ์์ด์ ๋ค์ ์ฝ๋๋ก ์์ฑ๋ฉ๋๋ค.
uncompressed.replace(/(.)\1{2,}/g,c=>c[0]+(c.length-3))
4 ๋นํธ ํจํน + RLE, 364 ๋ฐ์ดํธ
์๋ ๋ฌธ์์ด์๋ 9 ๊ฐ์ ๊ณ ์ ํ ๋ฌธ์๊ฐ ์์ต๋๋ค. ์ฆ, 4๋ ๊ฐ๊ฐ์ ๋ํ๋ด๋ ์ต์ ๋นํธ ์์ ๋๋ค. ํธ๋ฆฌํ๊ฒ, ์ด๊ฒ์ ์ ํํ 2 ๊ฐ์ ๋ฌธ์ ํํ์ ๋จ์ผ ๋ฐ์ดํธ์ ๋ง์ถ ์์๊ฒํ์ฌ ๋จ์ํ๊ณ ๊ณจํ ์นํ์ ์ธ ์์ถ ํด์ ์๊ณ ๋ฆฌ์ฆ์ ์ฌ์ฉํ ์์๊ฒํฉ๋๋ค. ๋ํ, 7 ๊ฐ์ ๋ฌธ์๊ฐ ๋จ์ผ๋ฏ๋ก ํฌ์ฅ ์ ์ ๊ธฐ๋ณธ 7 ๋ฐ ๊ธธ์ด ์ธ์ฝ๋ฉ์ ์ฌ์ฉํ ์ ์์ต๋๋ค. ๊ฐ 4 ๋นํธ ์ธ๋ฑ์ค๋ฅผ ๊ฐ ์์ถ ๋ฌธ์์ ์์ ๋ฐ ํ์ ๋๋ธ์ ๋ฃ๋ ๊ฒ์ CP-1252 ์ธ์ฝ๋ฉ์ด ์ฝ๋ ํฌ์ธํธ 256 ์๋์ ๋ชจ๋ ๋ฌธ์๋ฅผ ๋จ์ผ ๋ฐ์ดํธ๋ก ์ธ์ฝ๋ฉํ๊ธฐ ๋๋ฌธ์ ๋ฐ์ดํธ ๋น 2 ๊ฐ์ ๋ฌธ์๊ฐ ์ ์ฅ๋จ์ ์๋ฏธํฉ๋๋ค.
"ร\u0019\u0002รป1!ยฐ?4\u0002รซ14!ยฐ>C3\u0002=\u0001ร34\u0003ร1\u0002=4\u00011C3\u000114\u0002=C\u0013รฐ4\u0009\u001fCS\u0002m34\u0001>Iร 14s\u0002>C3\u0001=Iร1CS\u0002n34\u0013ร4\u0009\u001c34s\u0002?I3\u0001;Iยฐ1C3%รฐ6I3\u0001:Iย 1C3ub3\u0001l4\u00134\u0009\u001934S\u0007\u001bS'`\u0011ย V34\u0013\u00004\u0009\u001034\u0009:Z\u0002iยณ\u0001zC3\u00014\u00091Cs8Z'ยฐ6\u001bย 74Kยณ4\u00079['ร6\u001bยณ4Jยฃ4\u001a8Y'ย yรณ4I4]s\u0002ร7M34Cรw\u0002ยซ6u\u00021u\u0007`6\u0013\u0002รซss#รY"
.replace(/./g,c=>(l=" .\n:|;`',0123456")[(n=c.charCodeAt())&15]+l[n>>4])
.replace(/.\d+/g,c=>c[0].repeat(parseInt(c.slice(1),7)+3))
๋ค์ ์ฝ๋๋ ์คํ ๊ธธ์ด ์ธ์ฝ๋ฉ ๋ฐ ํจํน์ ์ํํ๋ ๋ฐ ์ฌ์ฉ๋ฉ๋๋ค.
chars="",max=16;
[...uncompressed].map(c=>~chars.indexOf(c)?0:chars+=c);
base=max-chars.length;
chars+=[...Array(base).keys()].join``;
unpacked=uncompressed.replace(/(.)\1{2,}/g,c=>c[0]+(c.length-3).toString(base));
packed=unpacked.replace(/(.|\n){2}/g,s=> // Note: unpacked length must be even!
String.fromCharCode(chars.indexOf(s[0])|(chars.indexOf(s[1])<<4)));
ํํ๋ง ์ฝ๋ฉ, (๊ฐ๋ฅํ ๋ฏธ๋ ๊ฐ์ )
ํน์ ๋ฌธ์๋ ๋ค๋ฅธ ๋ฌธ์๋ณด๋ค ํจ์ฌ ๋ง์ด ๋ฐ์ํ๋ฏ๋ก ํํ๋ง ์ธ์ฝ๋ฉ (๊ฐ ๋ฌธ์๋ฅผ ๋ํ๋ด๋ ๊ฐ๋ณ ๊ธธ์ด ์ ์)์ ์ถ๊ฐ ๋ฐ์ดํธ๋ฅผ ์ ์ฝ ํ ์ ์์ต๋๋ค. ๊ทธ๋ฌ๋ ์ด๋ ๊ฒํ๋ฉด ์์ถ ํด์ ์๊ณ ๋ฆฌ์ฆ์ ํจ์ฌ ๋ ๋ณต์กํด ์ง๋ฏ๋ก ํจ์ฌ ๋ ๋ง์ ์์ ์ธ์๋ ์์ถ ๋ ๋ฌธ์์ด์ ์ ์ฅํ๋ ๊ฒ๋ณด๋ค ์์ถ ํด์ ํ๋ ๋ฐ ๋ ๋ง์ ๋ฐ์ดํธ๊ฐ ํ์ํ ์ ์์ต๋๋ค.
๋ต๋ณ
์๋ฐ ์คํฌ๋ฆฝํธ ES6, 905 ๋ฐ์ดํธ
Whew .. 12 ์๊ฐ์ ์๊ณ๊ฐ ์งง์ง ์์ ํด๊ฒฐ์ฑ
์ ์ฃฝ์์ต๋๋ค .
์์คํค ์ํธ 898์๋ฅผ ์ธ์ํ๊ธฐ์ํ 905 ๋ฐ์ดํธ
_=>(a=(d=Date)(c=new d(),z=O=>Math.abs(new d(a[3]+O)-c)).split` `)[1]=='Apr'&a[2]==20|~a[4].search(/(04|16):20/)?'0,0,2ca2o,0,10e,0,0,1eu9z4,0,22w,1ulajuo,0,bklxc,2zgg,i,120gdfk,8lc,1s1s,15,j0jf9c,7em8,tac,10,190zcw0,tm8w,ksk,hra0ia,mihog0,3aels,wy,iv8e15,b98u80,cvs1s,575,9fm71g,190zcw0,bg7vgg,1t4,148d4lu,121pblx,b9ea68,2b36,iv8hn5,9zleso,15kytz4,98cp,4fwpwk,zir9ud,1h9u3ln,11c6vb4,84kda8,kbuo05,b98u84,14possy,k9su6i,a26hwk,zvft34,kavrpc,1tn1j4,1r3jis,kamgao,a5bhq8,2b2q,beyt6x,j0y810,muhiww,9xl,a5b7s8,14npcwi,1bkfw1s,4ys,14lipw4,kalr6k,0,1aq,kalqzg,0,48m,2j6hqf,zik0zk,0,33mcjk,0,5'.split`,`.map(a=>('0'.repeat(32)+parseInt(a,36).toString(2)).substr(-32)).join``.match(/.{1,3}/g).map(a=>` .:\`|;'
`[parseInt(a,2)]).join``:~~((T=Math.min(z('/4/20'),z(` ${a[1]} ${++a[2]} 0:4:20`),z(' 4:20'),z(' 0:4:20'),z(' 16:20'),z(' 0:16:20'))/1000)/60)+` minutes and ${~~(T%60)} seconds left until your next hit.`
Ungolfed ์ฝ๋
์ฐธ๊ณ : ungolfed ์ฝ๋๋ ์คํ๋์ง ์์ต๋๋ค
function() {
// (all vars here are actually global)
var d = Date; // short reference to Date object
var dateString = Date() // "Tue Apr 12 2016 20:13:00 GMT+0200 (W. Europe Daylight Time)"
.split` `; // ["Tue", "Apr", "12", ...]
var currentDate = new Date();
dateDiff = function(toAppend) {
return Math.abs( // no dates in the past
new Date(dateString[3] + toAppend) // new Date('2016' + something)
- currentDate // substract the current date.
// Thanks JS for the datetime implementation
);
}
if ((dateString[1] == 'Apr' & dateString[2] == 20) |
~dateString[4].search(/(04|16):20/)) { // if the time doesn't contain 04:20 or
// 16:20, this will return -1. ~-1 is 0
// and thus falsy
alert(printAscii());
} else {
alert(printTimeLeft());
}
}
function printAscii() {
var magicString = '0,0,2ca2o,0,10e,0,0,1eu9z4,0,22w,1ulajuo,0,bklxc,2zgg,i,120gdfk,8lc,1s1s,15,j0jf9c,7em8,tac,10,190zcw0,tm8w,ksk,hra0ia,mihog0,3aels,wy,iv8e15,b98u80,cvs1s,575,9fm71g,190zcw0,bg7vgg,1t4,148d4lu,121pblx,b9ea68,2b36,iv8hn5,9zleso,15kytz4,98cp,4fwpwk,zir9ud,1h9u3ln,11c6vb4,84kda8,kbuo05,b98u84,14possy,k9su6i,a26hwk,zvft34,kavrpc,1tn1j4,1r3jis,kamgao,a5bhq8,2b2q,beyt6x,j0y810,muhiww,9xl,a5b7s8,14npcwi,1bkfw1s,4ys,14lipw4,kalr6k,0,1aq,kalqzg,0,48m,2j6hqf,zik0zk,0,33mcjk,0,5' // ;)
var splitted = magicString.split`,`;
var binarySequence = splitted.map(function(piece) {
return ('0'.repeat(32) + // 000000000... this will be padded
parseInt(a,36) // parseInt('190zcw0',36) -> 000000002722627584
.toString(2) // -> 10100010010010000000000000000000
).substr(-32) // left pad binary sequence
}).join``; // create one big binary sequence from several smaller
var groupsOfThree = binarySequence.match(/.{1,3}/g);
return groupsOfThree.map(function(three) {
return ` .:\`|;'\n`[parseInt(a,2)]; // magic.. turn 010 into : etc
}).join``; // create them blaze
}
function printTimeLeft() {
// this is way longer than it should be.. probably
var minimumTimeDifference = Math.min(
dateDiff('/4/20'), // -> Difference between now and 2016/4/20 00:00:00
dateDiff(' 4:20'), // 2016 04:20:00.. Sadly the 2016 is needed (i think)
dateDiff(' 0:4:20'), // 2016 00:04:20
dateDiff(' 16:20'), // Damn 12 hour clock :(
dateDiff(' 0:16:20'),
dateDiff(` ${dateString[1]} // 2016 Apr
${dateString[2]+1} // 2016 Apr 13 (12+1)
0:4:20` // Check the first occurrence of 4 minutes and 20 seconds
// the next day
)
var timeInSeconds = minimumTimeDifference / 1000;
return Math.floor(timeInSeconds) + // ~~ works like Math.floor
` minutes and ${Math.floor(timeInSeconds%60)} seconds left until your next hit.`;
}
์๋ ํด๋ด!
f=
_=>(a=(d=Date)(c=new d(),z=O=>Math.abs(new d(a[3]+O)-c)).split` `)[1]=='Apr'&a[2]==20|~a[4].search(/(04|16):20/)?'0,0,2ca2o,0,10e,0,0,1eu9z4,0,22w,1ulajuo,0,bklxc,2zgg,i,120gdfk,8lc,1s1s,15,j0jf9c,7em8,tac,10,190zcw0,tm8w,ksk,hra0ia,mihog0,3aels,wy,iv8e15,b98u80,cvs1s,575,9fm71g,190zcw0,bg7vgg,1t4,148d4lu,121pblx,b9ea68,2b36,iv8hn5,9zleso,15kytz4,98cp,4fwpwk,zir9ud,1h9u3ln,11c6vb4,84kda8,kbuo05,b98u84,14possy,k9su6i,a26hwk,zvft34,kavrpc,1tn1j4,1r3jis,kamgao,a5bhq8,2b2q,beyt6x,j0y810,muhiww,9xl,a5b7s8,14npcwi,1bkfw1s,4ys,14lipw4,kalr6k,0,1aq,kalqzg,0,48m,2j6hqf,zik0zk,0,33mcjk,0,5'.split`,`.map(a=>('0'.repeat(32)+parseInt(a,36).toString(2)).substr(-32)).join``.match(/.{1,3}/g).map(a=>` .:\`|;'
`[parseInt(a,2)]).join``:~~((T=Math.min(z('/4/20'),z(` ${a[1]} ${++a[2]} 0:4:20`),z(' 4:20'),z(' 0:4:20'),z(' 16:20'),z(' 0:16:20'))/1000)/60)+` minutes and ${~~(T%60)} seconds left until your next hit.`
alert(f())
๋ค์ ์ฝ๋ ์ค ๋ํซ์์ ์์คํค ์ํธ๋ฅผ ํ ์คํธ ํ ๋ ์ง๋ฅผ ์ค์ ํ ์ ์์ต๋๋ค
day=prompt('Day?', 12);
month=prompt('Month?', 'Apr');
f=
_=>(a=(d=Date)(c=new d(),z=O=>Math.abs(new d(a[3]+O)-c)).split` `)[1]==month&a[2]==day|~a[4].search(/(04|16):20/)?'0,0,2ca2o,0,10e,0,0,1eu9z4,0,22w,1ulajuo,0,bklxc,2zgg,i,120gdfk,8lc,1s1s,15,j0jf9c,7em8,tac,10,190zcw0,tm8w,ksk,hra0ia,mihog0,3aels,wy,iv8e15,b98u80,cvs1s,575,9fm71g,190zcw0,bg7vgg,1t4,148d4lu,121pblx,b9ea68,2b36,iv8hn5,9zleso,15kytz4,98cp,4fwpwk,zir9ud,1h9u3ln,11c6vb4,84kda8,kbuo05,b98u84,14possy,k9su6i,a26hwk,zvft34,kavrpc,1tn1j4,1r3jis,kamgao,a5bhq8,2b2q,beyt6x,j0y810,muhiww,9xl,a5b7s8,14npcwi,1bkfw1s,4ys,14lipw4,kalr6k,0,1aq,kalqzg,0,48m,2j6hqf,zik0zk,0,33mcjk,0,5'.split`,`.map(a=>('0'.repeat(32)+parseInt(a,36).toString(2)).substr(-32)).join``.match(/.{1,3}/g).map(a=>` .:\`|;'
`[parseInt(a,2)]).join``:~~((T=Math.min(z('/4/20'),z(` ${a[1]} ${++a[2]} 0:4:20`),z(' 4:20'),z(' 0:4:20'),z(' 16:20'),z(' 0:16:20'))/1000)/60)+` minutes and ${~~(T%60)} seconds left until your next hit.`
alert(f())