Slackbotã«ã¹ã¿ã ã¬ã¹ãã³ã¹ã§NKODICEãã
TL;DR
Slackã®æ¨æºæ©è½ã®Slackbotã«ã¹ã¿ã ã¬ã¹ãã³ã¹ã§ã話é¡ã®ã²ã¼ã NKODICEãã§ããããã«ãã¦ã¿ãã
è¨å®æ¹æ³ã ãç¥ããã人ã¯ããã ãèªãã°OK
Slackbotã«ã¹ã¿ã ã¬ã¹ãã³ã¹ã¸ã®è¨å®æ¹æ³
NKODICEã¨ã¯
ksymãããéçºããããã³ãããããã¼ã¹ã¨ããã²ã¼ã ã
(ä»åãã®è¨äºã®å ¬éã«ã¤ãã¦ksymããã«ã快諾ããã ãã¾ããããããã¨ããããã¾ãð)
Slackbotã«ã¹ã¿ã ã¬ã¹ãã³ã¹ã¨ã¯
Slackã«ããã©ã«ãã«å ¥ã£ã¦ããæ©è½*1ã§ãSlackã§ä»»æã®ãã¼ã¯ã¼ããçºè¨ãããæã«Slackbotã«äºåã«è¨å®ããè¿çãããããã¨ãã§ããã
è¿çã®å 容ã¯ãæ¹è¡ã§åºåããã¨ãã£ã¦è¤æ°ã®åè£ã®ä¸ããã©ã³ãã ã«é¸æããããã¨ãã§ããã
è¿çã®æ大æåæ°
ããã¥ã¡ã³ããªã©ã«ã¯æ¸ããã¦ããªããã調æ»ããã¨ããè¿çã«è¨å®ã§ããæåæ°ã¯
æ大ã§4000 (æ¹è¡ã1æåã¨ãã¦ã«ã¦ã³ã)ã ã£ãã
è¿çãPythonã§ä½ã
ãã¹ã¦ã®è¿çãæä½æ¥ã§ä½ãã¨å¤§å¤ãªã®ã§ãPythonã§ä½ãã ãµã¤ã³ãã3ã¤ã®ã¨ãã¯ããããªæãã®ã³ã¼ãã§ã§ãããã ã
dice = ['ã', 'ã¡', 'ã¾', 'ã', 'ã', 'ã'] for i in dice: for j in dice: for k in dice: print(f'{i}{j}{k}')
NKODICEã«å¿ è¦ãªè¿çã®æåæ°
ãµã¤ã³ããnåã®æãè¿çããã¹ã¦æ¸ãåºãã®ã«å¿ è¦ãªæåæ°(æ¹è¡è¾¼ã¿)ã¯ä»¥ä¸ã®æ°å¼ã«ãã£ã¦æ±ããããã
6n*(n+1)-1
ãã®è§£ãã¾ã¨ããã¨ãã
ãµã¤ã³ãã®åæ° | è¿çããã¹ã¦æ¸ãåºãã®ã«å¿ è¦ãªæåæ° |
---|---|
1 | 11 |
2 | 107 |
3 | 863 |
4 | 6479 |
5 | 46655 |
6 | 326591 |
7 | 2239487 |
è¿çã«ç»é²ã§ããæ大æåæ°ã¯4000ãªã®ã§ããµã¤ã³ãã¯3ã¤ãéçã ã£ãã
@åä½ãããå®è£ æ¸ã¿ã§ã pic.twitter.com/gWA6kf66Qh
— haranicle (@haranicle) 2021å¹´6æ9æ¥
ãµã¤ã³ãã3ã¤ã ã¨ãæå¼·ã®å½¹ã§ããOCHINCHINãæç«ããªããæ²ãããã©ãã«ããã¦OCHINCHINãããã
æåæ°ãç¯ç´ãã¦ãµã¤ã³ãã®åæ°ãå¢ããæ¹æ³ãèãã
åãåºç®ã¯åé¤ãã
赤éç·ã®3ã¤ã®ãµã¤ã³ããæããæããããã¨ããã ãåºããã¨ãããããNKODICEã¯é ä¸åãªã®ã§ã©ã¡ããåãåºç®ã¨ãã¦æ±ãã
åºç®ã®è¡¨ç¾ã«å¿ è¦ãªæåæ°ãç¯ç´ããããã«ãåãçµã¿åããã®åºç®ãåé¤ããã
åãçµã¿åããã®åºç®ã®åé¤ã¯ç®ã®ã½ã¼ãçµæãsetã«ä»£å ¥ããã§å®è£ ããã
dice = ['ã', 'ã¡', 'ã¾', 'ã', 'ã', 'ã'] all_rolls = set() for i in range(6): for j in range(6): for k in range(6): sorted_roll = sorted([i]+[j]+[k]) a = '' for r in sorted_roll: a += str(dice[r]) all_rolls.add(a) for r in all_rolls: print(r)
ãã ãããã®æã使ãã¨å½¹ãåºã確çã代ãã£ã¦ãã¾ãã
ä¾ãã°ã赤ã¨éã®ã³ã¤ã³ãæããã¨ãã®çµæãæ¸ãåºãã¨ä»¥ä¸ã®ããã«ãªãã
- 表表
- 表è£
- è£è¡¨
- è£è£
æ¬æ¥ã¯ 表è£
ã®çµã¿åãããåºã確çã¯50%ã ããåãçµã¿åããã®åºç®ãåé¤ããå¦çãããã¨ã 表è£
ã®çµã¿åãããåºã確çã¯33.3%ã«ãªã£ã¦ãã¾ãã
ä»åã¯ã©ããã¦ãOCHINCHINãããã£ãã®ã§ããã®åé¡ã許容ãããã¨ã«ããã
å½¹ã¯Custom Emojiã§è¡¨ç¾
å½¹ãã§ããæã«æ´¾æãªè¡¨ç¾ããããã£ãã®ã§Custom Emojiã使ã£ãã Custom Emojiã®ä½æã«ã¯MEGAMOJIã使ããã¦ããã ããã
è¿çãå«ãã¦åºåããã³ã¼ãã¯ããããµã¤ã³ã5åãéçã ã£ãã
ãµã¤ã³ã5åããã°OCHINCHINãåºããã¨ãã§ãããè¯ãã£ãã
Slackbotã«ã¹ã¿ã ã¬ã¹ãã³ã¹ã¸ã®è¨å®æ¹æ³
Slackbotã«ã¹ã¿ã ã¬ã¹ãã³ã¹
- When someone says ã«
ãã,nko
ãå ¥å - Slackbot respondsã«ä»¥ä¸ãå ¥å
Slackbot respondsã«æ¸ãå 容
Custom Emojiã®ç»é²
ç»é²ãããã¡ã¤ã«ã¯ä»¥ä¸ã®å¥½ããªæ¹ãããã¦ã³ãã¼ãã(zipã§ãã¦ã³ãã¼ãããããã)
*1:ãã©ã°ã¤ã³ãªã©ã®å°å ¥ãä¸è¦ãªã®ã§ã©ããªç°å¢ã§ãå©ç¨ããããã®ãè¯ãã¨ãã