ã¡ã¢ãªç ´å£ã¨è¨ãã°â¦â¦ Core War ï¼ã³ã¢æ¦äºï¼ã¨ããããã°ã©ãã³ã°ã»ã²ã¼ã ã®ä¸ç¨®ãããã Core War ã§ã¯ Redcode ã¨å¼ã°ããä»®æ³ã¢ã»ã³ããªè¨èªãç¨ããããããã®è¨èªã使ã£ã¦æ¸ãããããã°ã©ã ãï¼åä¸ã®ã¡ã¢ãªç©ºéä¸ã§å®è¡ãï¼äºãã®ããã°ã©ã ãç ´å£ãåããããã§ï¼æå¾ã¾ã§æ¢ã¾ããã«çãæ®ã£ãããã°ã©ã ãåã¡ã¨ãªãã詳細ã«ã¤ãã¦ã¯ Coding Horror ã®ç´¹ä»è¨äºãã¾ã¨ã¾ã£ã¦ãã¦åèã«ãªãã é¢ç½ãã®ã¯ï¼ã¨ã«ããèªå·±è¤è£½ãè¡ãã¾ããããã°ã©ã ãå¼·ãï¼ã¨ããããã§ã¯ãªããã¨ãè¤è£½ã¯è¡ããï¼ããããã®åæ¢å½ä»¤ãã¡ã¢ãªä¸ã«ãã©æãã¦ï¼ç¸æããããè¸ãã§æ¢ã¾ãã®ãå¾ ã¤ã¨ããæ¦ç¥ãããããããã¯ï¼ç¸æã®ã³ã¼ãã®ä½ç½®ãç¹å®ãã¦ããç ´å£ãã«ãããæãããã Core War ã¨ãã°ã«ããã¡ã¢ãªç ´å£ã¯è²ã ã¨ãããéãããã©ï¼ãããã¬ã¼ã®ã¡ã¢ãªãã³ãã¨ç¨ãã£ãããªããã¹ãããå®è¡ã§ã¡
Coding Horror: The Danger of Naïveté é åã®ä¸èº«ãã©ã³ãã ãªé åºã«ã·ã£ããã«ããã³ã¼ããæ¸ããããåç´ã§ããããåãããããã¦ééãã®ç¡ãã³ã¼ããæ¸ãããä¾ãã°ï¼ãããªæãã«â¦â¦ for (int i = 0; i < cards.Length; i++) { int n = rand.Next(cards.Length); Swap(ref cards[i], ref cards[n]); } ããã¯åç´ã§åãããããï¼ ã§ãæ®å¿µï¼ ãã®ã³ã¼ãã¯ééã£ã¦ãããã·ã£ããã«å¾ã®é åºã«åããåºã¦ãã¾ããæ£è§£ã¯ãã¡ãã for (int i = cards.Length - 1; i > 0; i--) { int n = rand.Next(i + 1); Swap(ref cards[i], ref cards[n]); } ã±ã£ã¨è¦ã¦éããåããï¼ ã¤ã³
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}