ãã®èšäºã¯ traP Advent Calendar 2018 38æ¥ç®ã®èšäºã§ãã
ããã«ã¡ã¯ïŒDouble_oxygeNã§ããäžéçã«ã¯ä»æ¥ãAdvent Calendar 1æ¥ç®ã§ãããtraPã§ã¯37æ¥ãåããã¯ãªã¹ãã¹ðã楜ãã¿ã«ããŠããããšã«ãªããŸããïŒã¯ãªã¹ãã¹ã«traPã§äœãããã®ã§ããããâŠâŠâ
ããã¯ããŠãã
ä»åã®AdCãïŒããã°ã©ãã³ã°ã«é¢ããèšäºã®ä»ã«ãã²ãŒã ð®ã®çŽ¹ä»èšäºãã€ã©ã¹ãðšïŒãµãŠã³ãð¶çã®èšäºãªã©ãæ¢ã«äžãã£ãŠããŠïŒç§ãããã«ä¹ããŠã·ãã·ãã«é¢ããèšäºãåºããããªãšæã£ãŠããŸããããã·ãã·ãeã¹ããŒãã(PS4/Switch)ã¯ã¡ããã©æšæ¥ãŸã§ã§ã»ãŒã«ãçµäºãïŒã¿ã€ãã³ã°ãšããŠãããæãã ãšæãã®ã§ãã
ã¡ãªã¿ã«ç§ã¯eã¹ããŒãã§ã¯ãªããã·ãã·ãïŒïŒ 20th Anniversaryã(DS)ãæªã ã«éãã§ããŸããã²ãŒã ã«ãŒã«ã15çš®é¡ã«ïŒè±å¯ãªãã£ã©ã¯ã¿ãŒïŒã¹ããŒãªãŒã¢ãŒãïŒãã£ããã¢ãŒããããïŒãšããšãã·ãã·ãã§ã¯å·»ãæ»ããã§ããããšããšããããã
ãããšããã®ããã£ãŠéåžžã«ãªã¹ã¹ã¡ã§ãïŒïŒãDS以å€ã«ã3DSïŒWiiïŒPSPã§éã¶ããšãã§ããŸãã
ãšçŽ¹ä»ãããšããã§ïŒèå¿ã®AdCãŸã§ã«äºå®ããŠãããã¿ãããŸããŸãšãŸããªãã£ãã®ã§ïŒãã€ãéãèšèªçŽ¹ä»èšäºãæžããããšæããŸãã
ðEmojicodeð
ä»åã¯ïŒEmojicodeãšããããã°ã©ãã³ã°èšèªã玹ä»ããããšæããŸãã以åtraPãåºããæè¡æžã«ãEmojicodeã«ã€ããŠã®è©±ãæžãããŠããã ããŸãããïŒãããããŽã¡ãŒãžã§ã³ã0.6ã«äžãã£ãŠä»æ§ã倧ããå€ãã£ãããïŒæ¹ããŠã玹ä»ããããšæããŸãã
Emojicode
https://www.emojicode.org/
ðHello, World!
ãŸãã¯ãšã«ããHello WorldããŸãããã
ãã¡ã€ã«hello.emojic
ã«æ¬¡ã®ããã«ã³ãŒããæžããŸãã
hello.emojicð ð
ð ð€Hello, Emojicode!ð€ â
ð
ç§ã¯è³ã£ãŠçé¢ç®ã§ãã
ç¹åŸŽ
èšèªã®å称ããæããã§ããïŒäºçŽèªãçµµæåã§è¡šçŸãããŠããŸãã
äŸãã°ïŒðã¯ãæ¹è¡ä»ãåºå(echo
)ãïŒðã¯ããšã³ããªãã€ã³ã(main
)ãïŒð...ðã¯ããããã¯(begin
...end
)ããè¡šããŠããŸãã
å®è¡
å®è¡ã¯ïŒç«¯æ«ãã次ã®ããã«ã³ãã³ããå
¥åããŸãã
emojicodec
ãã³ã³ãã€ã©ã§ïŒã³ã³ãã€ã«ããããšã§ãã€ãã£ãŽã®ãã€ããªãåããŸãã
$ emojicodec hello.emojic
$ ./hello
Hello, Emojicode!
ãã®ä»ã®ç¹åŸŽã»é·æã»çæ
ãã®ä»ã«ãïŒEmojicodeã«ã¯æ¬¡ã®ãããªç¹åŸŽããããŸãã
ã¯ã©ã¹ããŒã¹ãªããžã§ã¯ãæå
Emojicodeã§ã¯ã¯ã©ã¹ðãäœãããšãã§ããŸãã
æ§æã¯Javaã«äŒŒãŠãããšæããŸãã
class_test.emojicð
ðŸã¯ã©ã¹
ð
ð ðŸ ð
ðïžð hp ð¢ ð ã¡ã³ãå€æ°
ð
ã³ã³ã¹ãã©ã¯ã¿
ð
ð initHp ð¢ ð
initHp â¡ïžðïž hp
ð
ð
ð¥âã¡ãœãã
ãã¡ãŒãžãäžããŠhpãæžãã
ð
â ð¥ damage ð¢ ð
âªïž hp â¶ïž 0 ð
hp â¬
ïžâ damage
ð
ð
ð
ð§âã¡ãœãã
hpããªããã©ããå€å®ãã
ð
â ð§ â¡ïž ð ð
â©ïž hp âïžð 0
ð
ð
äžã®ã³ãŒãã®ã³ã³ã¹ãã©ã¯ã¿ã¯ïŒåŒæ°ã®å€ãçŽæ¥ã¡ã³ãã«ä»£å ¥ããŠããã®ã§ïŒæ¬¡ã®ã³ãŒãã«çœ®ãæããããŸãã
ð ðŒ initHp ð¢ ðð
ã€ã³ã¹ã¿ã³ã¹çæïŒã¡ãœããåŒã³åºãã¯æ¬¡ã®ããã«è¡ããŸãã
ð ã€ã³ã¹ã¿ã³ã¹çæ
ððŸð 12 â â¡ïž invader
ð ã¡ãœããåŒåº
ð¥ invader 2 â
âªïž ð§ invader â ð
ð ð€CLEARED!ð€ â
ð
ã¯ã©ã¹ã¡ãœãã(ããããstatic
ã¡ãœãã)ã䜿ãããïŒã¯ã©ã¹ã®ä»ã«ãå€ã®äžå€æ§ãä¿æã§ããå€åãå€ãåæããåæåãäœãããããŸããïŒä»åã¯å²æããŸãã
第äžçŽé¢æ°
é¢æ°ãå€ãšããŠïŒåŒæ°ãæ»ãå€ã«ããããšãã§ããŸãã
callable_test.emojicðð
ð æŽæ° n ãå¥æ°ãã©ãããå€å®ããcallableãäœãïŒisOddã«ä»£å
¥
ð n ð¢ â¡ïž ð
â©ïž n ð® 2 ð 1
ð â¡ïž isOdd
ð callableãå®è¡
âïž isOdd 12 â â¡ïž isOdd(12)
âªïž isOdd(12) ð
ð ð€12 ã¯å¥æ°ã§ãð€ â
ð
ð
ð
ð ð€12 ã¯å¥æ°ã§ã¯ãããŸããð€ â
ð
ð ãªã¹ããäœæ
ðš 7 3 6 10 9 16 19 25 35 44 ð â¡ïž (ÂŽã»Ïã»ïœ)
ð ãªã¹ãã®èŠçŽ ããå¥æ°ã®èŠçŽ ã ããåãåºã(mapé¢æ°)
ð (ÂŽã»Ïã»ïœ) isOdd â â¡ïž (ÂŽã»Ïã»)
ð ãªã¹ãã®å
容ã10é²æ°ã§åºå
ð element (ÂŽã»Ïã») ð
ð ð¡ element 10 â â
ð
ð
åºå:
12 ã¯å¥æ°ã§ã¯ãããŸãã
7
3
9
19
25
35
äžèšã³ãŒãã®isOdd(12)
ã(ÂŽã»Ïã»ïœ)
ïŒ(ÂŽã»Ïã»)
ã(æ¬åŒ§ãå«ããŠ)å€æ°ã§ããEmojicodeã§ã¯ïŒçµµæåã空çœæå以å€ã®æåã¯èå¥åã«ãªãåŸãããïŒèªç±ã«å€æ°åã決ããããšãã§ããŸã(ãšã¯ããïŒèªã¿ãããå€æ°ã«ããŠããããšãéèŠã§ãã)ã
Emojicodeã®é·æ
- äºçŽèªã(åºæ¬)1èªã§ã³ãŒããéåžžã«ãã£ãããã
- ã·ã³ã¿ãã¯ã¹ãã€ã©ã€ããªãã§ãè²ãã€ããŠããã®ã§åºå¥å¯èœ
- Unicodeã«ç»é²ãããŠããçµµæåãç¡æèã®ãã¡ã«ææ¡ã§ãã
- çµµæåã«å¯Ÿãã芪è¿æãå¢ã
- è±èªã䜿ãå¿ èŠããªã
- ç¥ã£ãŠããïŒæžããã ãã§è©±ã®ãã¿ã«ã§ãã
- èŠãç®ãè¯ããã«ãªã
- 楜ããâ
Emojicodeã®çæ
- ãšãã£ã¿ãããŒã¯ããŒãã ãšé»ãçµµæå(âïžãðãªã©)ãèŠèŸã
- 1æéµã§1æåæãŠãªã
- ç°å¢ã«ãã£ãŠã¯æåã衚瀺ãããªã
- æç®ãè±èªãããªã
- ãŠãŒã¶ãå§åçã«å°ãªã
- ãŠãµã®ðã®ã€ã©ã¹ããèŠãŠã¯ã©ã¹ãé£æ³ããŠããŸãããã«ãªã
ðv0.6ã®äž»ãªå€æŽç¹
ã³ã³ãã€ã«
ä»ãŸã§ã®ã³ã³ãã€ã©ã¯ãã€ãã³ãŒããåãåºããŠïŒEmojicode VMäžã§åäœãããŠããã®ã§ããïŒv0.6ããã¯ã³ã³ãã€ã©ã«LLVMãå°å ¥ããŠïŒãã€ãã£ãŽãã€ããªã«ã³ã³ãã€ã«ã§ããããã«ãªããŸãããããã«ããïŒå®è¡é床ãå€§å¹ ã«æ¹åãããããã§ãã
çµµæåã®åéžå®
çµµæåã®èŠçŽããè¡ããïŒããèªã¿ããããªããŸããã
以äžã¯æ¹ããããçµµæåã®äžäŸã§ãã
åœ¹å² | å€æŽå | å€æŽåŸ |
---|---|---|
1è¡ã³ã¡ã³ã | ðŽ | ð |
è€æ°è¡ã³ã¡ã³ã | ðµ...ðµ | ðð...ðð |
if | ð | âªïž |
else | ð | ð |
elseif | ð | ð âªïž |
return | ð | â©ïž |
ããã¥ã¡ã³ãã³ã¡ã³ã | ð®...ð® | ð...ð ãŸã㯠ð...ð |
æŽæ°å | ð | ð¢ |
æµ®åå°æ°ç¹æ°å | ð | ð¯ |
äžçœ®æŒç®å
æŒç®åã¯ä»ãŸã§é¢æ°ãšåãæ±ãã§å眮èšæ³ã§æžãããšã«ãªã£ãŠããŸãããïŒv0.6ããã¯äžçœ®èšæ³ã§æžãããã«ãªããŸãããäžçœ®èšæ³ã®éã«å¿ èŠãªåªå é äœã®æ¬åŒ§ã¯ð€...ð€ã§è¡šããŸãã
2 â 3 âïž 4 ð 14
ð€ 2 â 3 ð€ âïž 4 ð 20
ã¡ãœããã®ã ãŒã
ã¡ãœããã«ã ãŒããšããæŠå¿µãå ãããŸãããã ãŒãã¯âãšâã®2çš®é¡ãçšæããïŒå®çŸ©æã«å¥œããªæ¹ãèªåã§éžæã§ããŸããåãã¡ãœããåã§ãã ãŒããç°ãªããšç°ãªãã¡ãœãããšããŠæ±ãããããïŒçåœå€ãè¿ãïŒãããã¯setterã§ãããããªã¡ãœããã¯âã䜿ãïŒãã以å€ã¯âã䜿ããªã©ïŒããŸã䜿ãåãããšè¯ãã§ããããã ãŒãã¯ïŒã¡ãœããå®çŸ©æã¯å é ã«æžãïŒã¡ãœããåŒã³åºãæã«ã¯æ«å°Ÿã«æžããŸãã
Unicode 11 察å¿
Unicode 11㯠2018幎6æ5æ¥ã«å ¬éãããŸãããè¿œå ãããæ°ããæåã衚瀺ã§ããç°å¢ã¯å€ããªãã§ããïŒEmojicode v0.6.2ããæ¢ã«ãµããŒãããŠããŠïŒã³ãŒãäžã§äœ¿ãããšãã§ããŸãããããèšèªã«çµµæåãçšããŠããã ããããŸãã
âšïžã©ããã£ãŠå ¥åããã
ããŠïŒãããŸã§Emojicodeã®é åãäŒããŠããŸãããïŒèå¿ã®ã³ãŒãã£ã³ã°ãã©ã®ããã«è¡ãã®ããšããåé¡ããããŸããmacOSã®å Žåã¯ïŒââSpace ã§ãçµµæåãšèšå·ãã衚瀺ãããããšãã§ããŸããïŒäžã æ€çŽ¢ããŠããã«ã¯ãªãã¯ããããã§ã¯äœæ¥å¹çããããããŸããã
ããã§çŽ¹ä»ãããã®ãïŒRocketãšããã¢ããªã§ãã
Rocket
https://matthewpalmer.net/rocket/
å®ã¯ãã®ã¢ããªã¯ïŒtraPéšå¡ã®sigmaããããããããããã®ã§ããã¢ããªãèµ·åãããç¶æ ã§ïŒããã¹ãå ¥åæã«ã³ãã³(:)ã«ç¶ããŠçµµæåã®å称ãå ¥åãããšïŒå¯Ÿå¿ããçµµæåããµãžã§ã¹ãããŠå€æããŠãããŸããããã玹ä»ããŠããããé°ã§ïŒç§ã®Emojicodeã³ãŒãã£ã³ã°ãçéã«ãªããŸããã
åºæ¬ã¯ç¡æçã§ååã§ããïŒ$5(USD)ã§ææçãè³Œå ¥ãããšïŒçµµæåã®å称ãèªåã§èªç±ã«è¿œå ããããšãã§ããããã«ãªããŸããäŸãã°ã:ifãã«ãâªïžãã察å¿ããããïŒã:blockãã«ãððãã察å¿ãããããããšïŒã³ãŒãã£ã³ã°æã«ãã¡ãã¡çµµæåãæãåºãå¿ èŠããªããªããŸããéåžžã«äŸ¿å©ãªã®ã§ïŒçãããEmojicodeã§ã³ãŒãã£ã³ã°ãããšãã¯ãããã§ããããã
ãããã«
Emojicodeã§ïŒãšã¢ãšã¢ãªçµµæåã©ã€ããéã£ãŠã¿ãã®ããããšæããŸããð€ã
ææ¥ã¯ïŒwhiteonionãšshirodoniãæ åœã§ããã楜ãã¿ã«ðã