- Author:
- Richard Sudaryono
- Twitter:
- @
- GitHub:
- gamehelp16
- Facebook:
- Google+:
- +
- Reddit:
- /r/
- Pouet:
- Website:
- gamehelp16.github.io
- Compo:
- pure
- Demo link:
- https://js1k.com/2017-magic/demo/2803
- Shortlink:
- https://js1k.com/2803
- Blog post:
- please update here!
- Bytes:
- 1005
- Chars:
- 1005
- Submission
for(_=`orCleBstyB>Ki;e(iJight:XinW.WnerHTMLRR="QheXP'+(OpxN5Nou}. y c;fC(i={colC:;bCder233280lidi0NtereonN;positi:"\\u266",cenr;</v><vlass= +' ">'+n+"<br>"+o">O3<n?o+o:o)functi;margW:xt-agn:rardb.childn[ e(a){A=D-a;a+=D;n=a%3+3;o=s[z=a%2*2+0|2*r()];3]R+=' "zO1<z?"":"")+'"> nn r"s as b">On^4?o:"")s+""}D=A=new Da%100;bQ<Kbody{ft:1 sans-serif}#q{splay:fBx;justify-cnt:Bftz{width:7;P10:1N sod #000-raus:5lative2ydn{ne-P13absolu;top:;Bft:r{transfCm:rota(180deg);bottom:;rXs{Btr-spacWg:1;ft-size:23N;P33N 0 0 8N}i#888-1 0 2}</K<h1>ThWk of aard</h1><i>(cck totWue)</i><v id=q>";s=[0356"];F="I'm abt to make sappear!0Focus ..0Say twice t ld0A ady?0Voil\\u00e0! Y is not he anymo!".spt(0)f=0;5>J++));d.cck=(){3]Q";5>f&&(1]R=F[f++]);if(4<f){s=[3065"]4;0<J--));2]Q"}}; r(){A=(9301*A+49297)%;turn A/};`;G=/[-N-RWXJKBC]/.exec(_);)with(_.split(G))_=join(shift());eval(_)
- Description
- A card magic trick in less than one kilobyte!
- Base64 encoded
Zm9yKF89YG9yQ2xlQnN0eUI+S2k7ZShpSmlnaHQ6WGluVy5XbmVySFRNTFJSPSJRaGVYUCcrKE9weE41Th9vdR59Lh0geRwgYxs7ZkMoaT0ae2NvbEM6GTtiQ2RlchgyMzMyODAXbGkWZGkVME4UdGUTcmUSb24RTjtwb3NpdGkROhAiXFx1MjY2DyIs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1hKS0JDXS8uZXhlYyhfKTspd2l0aChfLnNwbGl0KEcpKV89am9pbihzaGlmdCgpKTtldmFsKF8p
- Original source
/*
A = random seed
b = document.body (shim)
C = random seed backup
d = document (shim)
e(y) = generate random card
f = step
G = words
i = iterator
n = card number
o = card suit
r() = seeded rng
s = suits
z = card suit id
*/
function e(y) {
A = C - y;
y = C;
n = y%3 3;
o = s[z=(y%2)*2 0|r()*2];
b.children[3].innerHTML = '<div class="z' (z>1?' y':'') '"><div class=n>' n '<br>' o '</div><div class="n r">' n '<br>' o '</div><div class="s a">' (n>3?o o:o) '</div><div class="s b">' (n^4?o:'') '</div><div class="s c">' (n>3?o o:o) '</div></div>'
}
for(C=A=new Date%100,b.innerHTML='<style>body{text-align:center;font:15px sans-serif}#q{display:flex;justify-content:center;text-align:left}.z{width:70px;height:100px;border:1px solid #000;border-radius:5px;position:relative;margin:20px}.y{color:red}.n{line-height:13px;position:absolute;top:5px;left:5px}.r{transform:rotate(180deg);bottom:5px;right:5px}.s{text-align:center;letter-spacing:10px;font-size:23px;height:30px;margin:3px 0 0 8px}i{color:#888;margin:-10px 0 20px}</style><h1>Think of a card</h1><i>(click to continue)</i><div id=q></div>',s='♠♣♥♦'.split(''),G="I'm about to make your card disappear!0Focus on your card..0Say your card twice out loud0Are you ready?0Voilà! Your card is not here anymore!".split(0),i=f=0;i<5;e(i ));
d.onclick=function() {
b.children[3].innerHTML=''
if(f<5)b.children[1].innerHTML=G[f ]
if(f>4) {
for(s='♣♠♦♥'.split(''),i=4;i>0;e(i--));
b.children[2].innerHTML=''
}
};
function r() {
A = (A * 9301 49297) % 233280
return A / 233280
}