fork(2) download
  1. cards=[[ \๐Ÿ‚ก \๐Ÿ‚ข \๐Ÿ‚ฃ \๐Ÿ‚ค \๐Ÿ‚ฅ \๐Ÿ‚ฆ \๐Ÿ‚ง \๐Ÿ‚จ \๐Ÿ‚ฉ \๐Ÿ‚ช \๐Ÿ‚ซ \๐Ÿ‚ญ \๐Ÿ‚ฎ] [ \๐Ÿ‚ฑ \๐Ÿ‚ฒ \๐Ÿ‚ณ \๐Ÿ‚ด \๐Ÿ‚ต \๐Ÿ‚ถ \๐Ÿ‚ท \๐Ÿ‚ธ \๐Ÿ‚น \๐Ÿ‚บ \๐Ÿ‚ป \๐Ÿ‚ฝ \๐Ÿ‚พ] [ \๐Ÿƒ \๐Ÿƒ‚ \๐Ÿƒƒ \๐Ÿƒ„ \๐Ÿƒ… \๐Ÿƒ† \๐Ÿƒ‡ \๐Ÿƒˆ \๐Ÿƒ‰ \๐ŸƒŠ \๐Ÿƒ‹ \๐Ÿƒ \๐ŸƒŽ] [ \๐Ÿƒ‘ \๐Ÿƒ’ \๐Ÿƒ“ \๐Ÿƒ” \๐Ÿƒ• \๐Ÿƒ– \๐Ÿƒ— \๐Ÿƒ˜ \๐Ÿƒ™ \๐Ÿƒš \๐Ÿƒ› \๐Ÿƒ \๐Ÿƒž]]
  2. deck=[[0 0 false ] [0 1 2] [0 2 3] [0 3 4] [0 4 5] [0 5 6] [0 6 7] [0 7 8] [0 8 9] [0 9 10] [0 10 10] [0 11 10] [0 12 10] [1 0 false ] [1 1 2] [1 2 3] [1 3 4] [1 4 5] [1 5 6] [1 6 7] [1 7 8] [1 8 9] [1 9 10] [1 10 10] [1 11 10] [1 12 10] [2 0 false ] [2 1 2] [2 2 3] [2 3 4] [2 4 5] [2 5 6] [2 6 7] [2 7 8] [2 8 9] [2 9 10] [2 10 10] [2 11 10] [2 12 10] [3 0 false ] [3 1 2] [3 2 3] [3 3 4] [3 4 5] [3 5 6] [3 6 7] [3 7 8] [3 8 9] [3 9 10] [3 10 10] [3 11 10] [3 12 10] ]
  3. sdeck=JSON.parse JSON.stringify deck
  4. shuffle = !-> for x,i in deck when (x=Math.floor(Math.random() * (i + 1));true)
  5. [deck[i],deck[x]] = [deck[x],deck[i]]
  6. gid=(id) -> document.getElementById(id)
  7. window.mca=mc=[];window.dca=dc=[];defbet=gid("defbet");m=gid("money");bet=gid("bet");mch=gid("mcards");dch=gid("dcards");l=gid("log")
  8. tod = !-> dc.push (c=deck.pop!); dch.innerHTML+=cards[c[0]][c[1]]
  9. log = (msg)!-> l.innerHTML=msg
  10. window.more = tom = !-> mc.push (c=deck.pop!); mch.innerHTML+=cards[c[0]][c[1]]; summ(mc)>21 and (log "ะŸะตั€ะตะฑะพั€";gid("e").disabled=true;gid("g").disabled=false)
  11. clear = !->
  12. gid("g").disabled=!(gid("e").disabled=false);log "";bet.innerHTML=0;mch.innerHTML=dch.innerHTML="";mc.length=0;dc.length=0;deck:=JSON.parse JSON.stringify sdeck;shuffle!
  13. window.s=summ = (ar)->
  14. sum=0;tzs=0
  15. for c in ar
  16. (c[2] and sum+=c[2]) or tzs++
  17. for i in [1 to tzs]
  18. (sum+11>21 and sum+=1) or sum+=11
  19. sum
  20. betbet = -> if +m.innerHTML<+defbet.value then log "ะฃ ะฒะฐั ะฝะตั‚ ัั‚ะพะปัŒะบะพ ะดะตะฝะตะณ!"; false else bet.innerHTML=+defbet.value;m.innerHTML-=+defbet.value;true
  21. window.dub = !-> if +m.innerHTML<+bet.innerHTML then log "ะฃ ะฒะฐั ะฝะตั‚ ัั‚ะพะปัŒะบะพ ะดะตะฝะตะณ!" else m.innerHTML-=+bet.innerHTML;bet.innerHTML*=2;tom!
  22. window.give = !-> (clear!; betbet!) and (tom!;tom!;tod!;true) or gid("g").disabled=false;!mc[0][2] and !mc[1][2] and (log "ะ’ั‹ ะฒั‹ะธะณั€ะฐะปะธ!"; m.innerHTML = +m.innerHTML + +bet.innerHTML*3;gid("e").disabled=true;gid("g").disabled=false)
  23. window.enough = !->
  24. win=true
  25. while summ(dc) < 17
  26. tod!
  27. log if summ(dc)>21 or summ(dc)<summ(mc) then "ะ’ั‹ ะฒั‹ะธะณั€ะฐะปะธ!" else (win=false; "ะ’ั‹ ะฟั€ะพะธะณั€ะฐะปะธ")
  28. gid("g").disabled=false
  29. gid("e").disabled=true
  30. win and m.innerHTML = +m.innerHTML + +bet.innerHTML*2
Runtime error #stdin #stdout #stderr 0.34s 381888KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
js: "prog.js", line 1: illegal character
js: cards=[[ \๐Ÿ‚ก \๐Ÿ‚ข \๐Ÿ‚ฃ \๐Ÿ‚ค \๐Ÿ‚ฅ \๐Ÿ‚ฆ \๐Ÿ‚ง \๐Ÿ‚จ \๐Ÿ‚ฉ \๐Ÿ‚ช \๐Ÿ‚ซ \๐Ÿ‚ญ \๐Ÿ‚ฎ] [ \๐Ÿ‚ฑ \๐Ÿ‚ฒ \๐Ÿ‚ณ \๐Ÿ‚ด \๐Ÿ‚ต \๐Ÿ‚ถ \๐Ÿ‚ท \๐Ÿ‚ธ \๐Ÿ‚น \๐Ÿ‚บ \๐Ÿ‚ป \๐Ÿ‚ฝ \๐Ÿ‚พ] [ \๐Ÿƒ \๐Ÿƒ‚ \๐Ÿƒƒ \๐Ÿƒ„ \๐Ÿƒ… \๐Ÿƒ† \๐Ÿƒ‡ \๐Ÿƒˆ \๐Ÿƒ‰ \๐ŸƒŠ \๐Ÿƒ‹ \๐Ÿƒ \๐ŸƒŽ] [ \๐Ÿƒ‘ \๐Ÿƒ’ \๐Ÿƒ“ \๐Ÿƒ” \๐Ÿƒ• \๐Ÿƒ– \๐Ÿƒ— \๐Ÿƒ˜ \๐Ÿƒ™ \๐Ÿƒš \๐Ÿƒ› \๐Ÿƒ \๐Ÿƒž]]
js: ..........^
js: "prog.js", line 1: illegal character
js: cards=[[ \๐Ÿ‚ก \๐Ÿ‚ข \๐Ÿ‚ฃ \๐Ÿ‚ค \๐Ÿ‚ฅ \๐Ÿ‚ฆ \๐Ÿ‚ง \๐Ÿ‚จ \๐Ÿ‚ฉ \๐Ÿ‚ช \๐Ÿ‚ซ \๐Ÿ‚ญ \๐Ÿ‚ฎ] [ \๐Ÿ‚ฑ \๐Ÿ‚ฒ \๐Ÿ‚ณ \๐Ÿ‚ด \๐Ÿ‚ต \๐Ÿ‚ถ \๐Ÿ‚ท \๐Ÿ‚ธ \๐Ÿ‚น \๐Ÿ‚บ \๐Ÿ‚ป \๐Ÿ‚ฝ \๐Ÿ‚พ] [ \๐Ÿƒ \๐Ÿƒ‚ \๐Ÿƒƒ \๐Ÿƒ„ \๐Ÿƒ… \๐Ÿƒ† \๐Ÿƒ‡ \๐Ÿƒˆ \๐Ÿƒ‰ \๐ŸƒŠ \๐Ÿƒ‹ \๐Ÿƒ \๐ŸƒŽ] [ \๐Ÿƒ‘ \๐Ÿƒ’ \๐Ÿƒ“ \๐Ÿƒ” \๐Ÿƒ• \๐Ÿƒ– \๐Ÿƒ— \๐Ÿƒ˜ \๐Ÿƒ™ \๐Ÿƒš \๐Ÿƒ› \๐Ÿƒ \๐Ÿƒž]]
js: ..........^
js: "prog.js", line 1: missing ] after element list
js: cards=[[ \๐Ÿ‚ก \๐Ÿ‚ข \๐Ÿ‚ฃ \๐Ÿ‚ค \๐Ÿ‚ฅ \๐Ÿ‚ฆ \๐Ÿ‚ง \๐Ÿ‚จ \๐Ÿ‚ฉ \๐Ÿ‚ช \๐Ÿ‚ซ \๐Ÿ‚ญ \๐Ÿ‚ฎ] [ \๐Ÿ‚ฑ \๐Ÿ‚ฒ \๐Ÿ‚ณ \๐Ÿ‚ด \๐Ÿ‚ต \๐Ÿ‚ถ \๐Ÿ‚ท \๐Ÿ‚ธ \๐Ÿ‚น \๐Ÿ‚บ \๐Ÿ‚ป \๐Ÿ‚ฝ \๐Ÿ‚พ] [ \๐Ÿƒ \๐Ÿƒ‚ \๐Ÿƒƒ \๐Ÿƒ„ \๐Ÿƒ… \๐Ÿƒ† \๐Ÿƒ‡ \๐Ÿƒˆ \๐Ÿƒ‰ \๐ŸƒŠ \๐Ÿƒ‹ \๐Ÿƒ \๐ŸƒŽ] [ \๐Ÿƒ‘ \๐Ÿƒ’ \๐Ÿƒ“ \๐Ÿƒ” \๐Ÿƒ• \๐Ÿƒ– \๐Ÿƒ— \๐Ÿƒ˜ \๐Ÿƒ™ \๐Ÿƒš \๐Ÿƒ› \๐Ÿƒ \๐Ÿƒž]]
js: ..........^
js: "prog.js", line 1: illegal character
js: cards=[[ \๐Ÿ‚ก \๐Ÿ‚ข \๐Ÿ‚ฃ \๐Ÿ‚ค \๐Ÿ‚ฅ \๐Ÿ‚ฆ \๐Ÿ‚ง \๐Ÿ‚จ \๐Ÿ‚ฉ \๐Ÿ‚ช \๐Ÿ‚ซ \๐Ÿ‚ญ \๐Ÿ‚ฎ] [ \๐Ÿ‚ฑ \๐Ÿ‚ฒ \๐Ÿ‚ณ \๐Ÿ‚ด \๐Ÿ‚ต \๐Ÿ‚ถ \๐Ÿ‚ท \๐Ÿ‚ธ \๐Ÿ‚น \๐Ÿ‚บ \๐Ÿ‚ป \๐Ÿ‚ฝ \๐Ÿ‚พ] [ \๐Ÿƒ \๐Ÿƒ‚ \๐Ÿƒƒ \๐Ÿƒ„ \๐Ÿƒ… \๐Ÿƒ† \๐Ÿƒ‡ \๐Ÿƒˆ \๐Ÿƒ‰ \๐ŸƒŠ \๐Ÿƒ‹ \๐Ÿƒ \๐ŸƒŽ] [ \๐Ÿƒ‘ \๐Ÿƒ’ \๐Ÿƒ“ \๐Ÿƒ” \๐Ÿƒ• \๐Ÿƒ– \๐Ÿƒ— \๐Ÿƒ˜ \๐Ÿƒ™ \๐Ÿƒš \๐Ÿƒ› \๐Ÿƒ \๐Ÿƒž]]
js: ...........^
js: "prog.js", line 1: Compilation produced 4 syntax errors.