ã¿ã¼ãã«ããã°ã©ãã³ã°ã®åºæ¬ï¼ãç¹°ãè¿ãforæã®èª¬æã¨ä½¿ãæ¹
- ã¯ããã«
- ãããããã°ã©ã ã®åé¡ç¹
- ç¹°ãè¿ãforæ ã®ç´¹ä»
- æ°åå¨ãã£ã¦ç¥ã£ã¦ãï¼
- ã«ã¦ã³ã¿å¤æ°ã£ã¦ä½ã
- ãåºãããã¯ã6æ©å ã¾ã§æ·ãè©°ããããã°ã©ã ã
- ãåºãããã¯ã6æ©å ã¾ã§æ·ãè©°ãããããã®ã¾ã¾æãè¿ãã¦ï¼Uã¿ã¼ã³ãã¦ï¼æ»ã£ã¦ããããã°ã©ã ã
- ã¾ã¨ãã¨ä»åã®å®¿é¡
ã¯ããã«
ååã®è¨äºã®æå¾ã«èª²é¡ãåºãã¾ãããã§ãã¾ãããï¼
ãåºãããã¯ã6æ©å
ã¾ã§æ·ãè©°ããããã°ã©ã ãã®è§£çä¾ã¯ã³ã³
turtle.up() turtle.placeDown() turtle.forward() turtle.placeDown() turtle.forward() turtle.placeDown() turtle.forward() turtle.placeDown() turtle.forward() turtle.placeDown() turtle.forward() turtle.placeDown() turtle.forward()
ãåºãããã¯ã6æ©å
ã¾ã§æ·ãè©°ãããããã®ã¾ã¾æãè¿ãã¦ï¼Uã¿ã¼ã³ãã¦ï¼æ»ã£ã¦ããããã°ã©ã ãã®è§£çä¾ã¯ã³ã³
turtle.up() turtle.placeDown() turtle.forward() turtle.placeDown() turtle.forward() turtle.placeDown() turtle.forward() turtle.placeDown() turtle.forward() turtle.placeDown() turtle.forward() turtle.placeDown() turtle.forward() turtle.turnRight() turtle.turnRight() turtle.forward() turtle.forward() turtle.forward() turtle.forward() turtle.forward() turtle.forward()
ããããæ¯ãè¿ããªãã¦ããããã¯ã§ï¼turtle.back()
ï¼æ»ã£ã¦ãã¦ãããããã
ãããããã°ã©ã ã®åé¡ç¹
ååã®èª²é¡ãããã§ãããããã°ã©ã ãæ¸ãã¦ãããã¡ã«æãã¾ããã§ãããï¼
ãããã©ãããããä½åº¦ãåããã¨æ¸ãã®ãªãã¨ããªããªãã®ï¼ã
ã§ããããå®ã¯ããã¨ãããã課é¡ãåºãã¾ãããï¼æå°ã®æªãç¬é¡ï¼
å®ã¯ããã°ã©ãã³ã°è¨èªLuaã«ã¯ããã®ãããªãä½åº¦ãåããã¨ããããã¨ãã«ããã£ã¨ç°¡åã«è¨è¿°ããæ¹æ³ãä½éããããã¾ãã
ä»åã¯ãã®ãã¡ã®ä¸ã¤ããç¹°ãè¿ãforæããç´¹ä»ãã¾ãããã
ç¹°ãè¿ãforæ ã®ç´¹ä»
åãæé ãä½åº¦ãç¹°ãè¿ãéã«ããã®ç¹°ãè¿ãåæ°ããããããããã£ã¦ãããªããç¹°ãè¿ãforæããå©ç¨ã§ãã¾ãã
以ä¸ã¯ä½¿ç¨ä¾ã§ãã
for count=1,6 do turtle.forward() end
ãã®è¨è¿°ã¯æ¬¡ã®è¨è¿°ã¨ã»ã¼åãè¨è¿°ã¨ãªãã¾ãã
turtle.forward() turtle.forward() turtle.forward() turtle.forward() turtle.forward() turtle.forward()
ã¤ã¾ããã®ç¹°ãè¿ãForæã使ããã¨ã§ãåæ°æå®ãã¦åãæé ãç¹°ãè¿ããã¨ãã§ããããã§ãã
åãã¦åºã¦ããæãªã®ã§ãããå°ããã®æã®ä½¿ãæ¹ã詳ãã説æãã¾ãããã
ã¾ãåºæ¬çãªæ§é ã¯ä»¥ä¸ã®ããã«èª¬æã§ãã¾ãã
for ã«ã¦ã³ã¿å¤æ°å = åæå¤, æçµå¤ do ç¹°ãè¿ãããæé end
ç·è²ã®é¨åãä¸çªå¤§ããªæ§é ã§ãã ã¤ã¾ããfor ã«ã¦ã³ã¿ã®è¨å® do ç¹°ãè¿ãããå 容 endãã¨ããæ§é ã«ãªã£ã¦ãã¾ãã
ãã®ãã¡ããç¹°ãè¿ãããæé ãã«ã¤ãã¦ã¯ãããã§ã好ãã«æ¸ãã°ããã®ã§åé¡ãªãã¨ãã¦ãç解ãã¥ããã®ã¯ãã«ã¦ã³ã¿ã®è¨å®ãé¨åã§ãããã
æ°åå¨ãã£ã¦ç¥ã£ã¦ãï¼
ããã§ããã«ã¦ã³ã¿ã¨ã¯ãããã°æ°åå¨ï¼ããã¨ããã度æ°è¨ã¨ãï¼ã®ãããªãã®ã§ãã
æ¥æ¬éé³¥ã®ä¼ã®äººãé³¥ã®æ°ãã«ã¦ã³ããããã交éé調æ»ã®ã¢ã«ãã¤ããã¦ãã人ãè»ãªã©ãã«ã¦ã³ãããããã«ãã«ãã«ãã«ãã¨ãã¿ã³ãæ¼ãã¦æ°åãå¢ããã¦ããæ©å¨ã§ããã
ãã®æ°åå¨ã«ç¾å¨ã«ã¦ã³ãããå¤ãè¦ãããã¦ãããã¨ãã§ããå¾ãããã®å¤ãåç §ã§ããã¨ããããã¤ã³ãã§ãã
count=1, 6
ããã°ã©ã ã§ã¯ãã®ã«ã¦ã³ã¿ã«å¥½ããªååãã¤ãããã¨ãã§ããã®ã§ãä»åã¯ãcountãã¨ããååãã¤ãã¦ãã¾ã1ããã®ä¸ã§ãæåã®å¤ãã1ãã«è¨å®ãã¦ãã¾ãã
ç¹°ãè¿ãforæã¯å 容ãç¹°ãè¿ããã¨ã«ãã®ã«ã¦ã³ã¿ã®å¤ã1ãã¤å¢ããã¦ããã¾ãã æçµå¤ã¨ãã¦ã6ãã¨æ¸ãã¦ãã¾ãã®ã§ãæçµçã«ãã®ã«ã¦ã³ã¿ã®å¤ãã6ãã«ãªã£ãã¨ãã«ç¹°ãè¿ããçµäºãã¾ãã
ã¤ã¾ãã以ä¸ã®ç¹°ãè¿ãforæã®å 容ãå³å¯ã«èª¬æãããªãã°ã次ã®ããã«ãªãããã§ãã
for count=1,6 do turtle.forward() end
- ã¾ããã«ã¦ã³ã¿å¤æ°ãcountãã®å¤ã1ã«ãã¦Foræã®doãendå ãå®è¡ãããï¼
turtle.forward()
ä¸æ©é²ã- ã«ã¦ã³ã¿å¤æ°ãcountãã®å¤ã2ã«ãã¦Foræã®doãendå ãå®è¡ãããï¼
turtle.forward()
ä¸æ©é²ã- ã«ã¦ã³ã¿å¤æ°ãcountãã®å¤ã3ã«ãã¦Foræã®doãendå ãå®è¡ãããï¼
turtle.forward()
ä¸æ©é²ã- ã«ã¦ã³ã¿å¤æ°ãcountãã®å¤ã4ã«ãã¦Foræã®doãendå ãå®è¡ãããï¼
turtle.forward()
ä¸æ©é²ã- ã«ã¦ã³ã¿å¤æ°ãcountãã®å¤ã5ã«ãã¦Foræã®doãendå ãå®è¡ãããï¼
turtle.forward()
ä¸æ©é²ã- ã«ã¦ã³ã¿å¤æ°ãcountãã®å¤ã6ã«ãã¦Foræã®doãendå ãå®è¡ãããï¼
turtle.forward()
ä¸æ©é²ã- ã«ã¦ã³ã¿å¤æ°ãcountãã®å¤ã¯æçµå¤ã®6ã«ãªã£ã¦ããããããããã¾ãï¼
ã¾ã¨ããã¨ãcount ã 1ã®ã¨ãã®å®è¡ã2ã®ã¨ãã®å®è¡ã3ã®ã¨ãã®å®è¡ã4ã®ã¨ãã®å®è¡ã5ã®ã¨ãã®å®è¡ã6ã®ã¨ãã®å®è¡ã¨è¨6åã®ç¹°ãè¿ããè¡ããã¾ãã
ã«ã¦ã³ã¿å¤æ°ã£ã¦ä½ã
ãªããããã§ããããªããå¤æ°ãã¨ããç¨èªã使ã£ã¦ãã¾ãããããã°ã©ãã³ã°è¨èªã«ãããå¤æ°ã¨ã¯ãæ°åãæåãªã©å¥½ããªãã®ãä¸æçã«ä¿ç®¡ãã¦ããã¦ãã¨ã§è¨åã§ããååä»ãã®ç®±ãã ã¨è¦ãã¦ããã¨ãä»ã®æ®µéã§ã¯æ¦ãåé¡ãªãã§ãããã
ååä»ãã®ä¸æä¿ç®¡ç®±ãªã®ã§ããããããã°ãcountã¨ããç®±ã®ä¸ã£ã¦ä»ä½ãå ¥ã£ã¦ããã£ãï¼ãã¨ãããã®countã®ä¸ã«å ¥ã£ã¦ãããã¤ã£ã¦ãã»ã»ã»ããªã©ã¨ãå¾ã§å¤æ°åã使ã£ã¦ãã®ä¸èº«ã«ã¤ãã¦è¨åã§ããã®ããã¤ã³ãã§ãã2
ãã¨ãã°ã次ã®ãããªããã°ã©ã ãæ¸ãã¨ãforæã®æåãç解ãããããªãããããã¾ããã å®éã«ä½ã£ã¦è©¦ãã¦ã»ããã®ã§ãã¿ã¼ããã«ç»é¢ããããã°ã©ã ãhensu0ããæ¸ãã¦ã¿ã¾ãããã
> edit hensu0
次ã®ããã°ã©ã ãæ¸ãã
ã¿ã¼ããã«ç»é¢ã§å®è¡ãã
> hensu0
ãã®ããã°ã©ã ã¯ãforæã®æåãç解ããã®ã«æé©ã§ãã
- countã1ã«ãªãã¾ããããã®countã®å¤ãç»é¢ã«è¡¨ç¤ºãã¦ï¼ãâã1
- countã2ã«ãªãã¾ããããã®countã®å¤ãç»é¢ã«è¡¨ç¤ºãã¦ï¼ãâã2
- countã3ã«ãªãã¾ããããã®countã®å¤ãç»é¢ã«è¡¨ç¤ºãã¦ï¼ãâã3
- countã4ã«ãªãã¾ããããã®countã®å¤ãç»é¢ã«è¡¨ç¤ºãã¦ï¼ãâã4
- countã5ã«ãªãã¾ããããã®countã®å¤ãç»é¢ã«è¡¨ç¤ºãã¦ï¼ãâã5
- countã6ã«ãªãã¾ããããã®countã®å¤ãç»é¢ã«è¡¨ç¤ºãã¦ï¼ãâã6
ã¤ã¾ããforæã®ç¹°ãè¿ãã«ä¼´ã£ã¦å¤åããã«ã¦ã³ã¿å¤æ°ã®å¤ã表示ããããã°ã©ã ã§ãã
ãããforæã®ä½¿ãæ¹ããããã¾ãããï¼ ãã®foræã使ã£ã¦ä»ã¾ã§ã®ããã°ã©ã ãä½ãç´ãã¦ã¿ã¾ãããã
ãåºãããã¯ã6æ©å ã¾ã§æ·ãè©°ããããã°ã©ã ã
turtle.up() for count=1,6 do turtle.placeDown() turtle.forward() end
ãã®ç¡é§ã«é·ãããã°ã©ã ããããªã«ç°¡åã«ã»ã»ã»ï¼æç¡éï¼
ãªããforæã§ç¹°ãè¿ãããæé ã¯ãè¡é ã«åè§ã¹ãã¼ã¹ã2åãå ¥ãã¦åä¸ããããã¨ã§è¦ããã工夫ãã¾ããã3ãè¡é ã¹ãã¼ã¹ã®ãã¨ãã¤ã³ãã³ãã¨å¼ã¶ã®ã§ããããã¨ãã°ã以ä¸ã®ã¤ã³ãã³ãããªãæªãä¾ã¨æ¯ã¹ãã¨ããããããã段éãã§ãããã
ããããããããã°ã©ã ã®ããã«ãforæã§ç¹°ãè¿ãæé ã«ã¯ã¤ã³ãã³ããå ¥ããçãã¤ãã¾ãããã
turtle.up() for count=1,6 do turtle.placeDown() turtle.forward() end
ãåºãããã¯ã6æ©å ã¾ã§æ·ãè©°ãããããã®ã¾ã¾æãè¿ãã¦ï¼Uã¿ã¼ã³ãã¦ï¼æ»ã£ã¦ããããã°ã©ã ã
turtle.up() for count=1,6 do turtle.placeDown() turtle.forward() end turtle.turnRight() turtle.turnRight() for count=1,6 do turtle.forward() end
ãããããçããã·ã³ãã«ã
ã¾ã¨ãã¨ä»åã®å®¿é¡
ä»åã®è¨äºã§ãç¹°ãè¿ãforæã使ã£ãããã°ã©ã ã®æ¸ãæ¹ãå¦ã³ã¾ããã ç¹°ãè¿ãåæ°ããããããããã£ã¦ããæã«ã¯ãç¹°ãè¿ãforæã使ãã¨ããã°ã©ã ãã¨ã¦ãã·ã³ãã«ã«ãªãã¾ãã
ãã¦ãããã§ã¯ä»åã®ç·ã¾ã¨ãã¨ãã¦ã次ã®èª²é¡ã宿é¡ã¨ãã¦ãã£ã¦ã¿ã¾ãããã 解çã¯æ¬¡åã®è¨äºã§ã
- ãyuka1ãããã°ã©ã
- ãåºãããã¯ã6æ©å ã¾ã§æ·ãè©°ãããããã®ã¾ã¾æè¨åãã«Uã¿ã¼ã³ãã¦ãåºãããã¯ã6æ©åæ·ãè©°ããªããæ»ã£ã¦ããããã°ã©ã ã
ä»åã¯foræã®è§£èª¬ã§ããã次åã¯æ¬¡ã®ãããªããã°ã©ã ãä½ãã¾ããå®ã¯ããã¾ã§ã®ç¥èã ãã§ååä½ãã¾ãã®ã§ãèªåã§ããã£ã¬ã³ã¸ãã¦ã¿ããï¼#ComputerCraft #ç¾åã®ãã¤ã¯ã©ã¨ååã®ã¿ã¼ãã« pic.twitter.com/M84CpZWOKw
— hevo2 and ð¢ (@hevohevo) 2019å¹´9æ22æ¥
-
å¤æ°åã¯å¥½ãã«ã¤ãã¦è¯ãã®ã§ãããæ £ç¿ã¨ãã¦ãforæå ã®ã«ã¦ã³ã¿å¤æ°åã¯ãiããjããkããããããã使ãããããã§ããä»åã¯ããããããéè¦ã§ãcountãã¨åä»ãã¾ããã↩
-
ãã ãå¤æ°ã«ã¯ãã¹ã³ã¼ããã¨å¼ã°ããæå¹ç¯å²ãããã¾ããå¤æ°ã¯ããã¾ã§ä¸æçãªä¿ç®¡å ´æãªã®ã§ããã¤ã§ãã©ãã§ããã®å¤æ°ãåç §ã§ããããã§ã¯ããã¾ãããå¤æ°ã®ç¨®é¡ã«ãã£ã¦ããã°ã©ã ä¸ã®ã©ã®åºéã§åç §ã§ãããã®ã¹ã³ã¼ãã決ã¾ãã¾ããä»åã®foræå ã®ã«ã¦ã³ã¿å¤æ°ã®ã¹ã³ã¼ãã¯ããã®foræã®ä¸ã ãã¨ãªãã¾ãããã®ããããã®foræã®å¤ã§ã«ã¦ã³ã¿å¤æ°ãåç §ãã¦ãããããªå¤æ°ç¥ããããã¨ã¾ã¨ããªçãã¯è¿ã£ã¦ãã¾ããã↩
-
è¡é ã¹ãã¼ã¹ï¼ã¤ã³ãã³ãï¼ã®å ¥ãæ¹ã«ã¯æµæ´¾ãããã¾ããåè§ã¹ãã¼ã¹2åã®å ´åãåè§ã¹ãã¼ã¹4åã®å ´åãã¯ãã¾ãTabã¹ãã¼ã¹ã®å ´åãããã§ã¯ç§ã好ããªæµæ´¾ã§ããåè§ã¹ãã¼ã¹2åãæ¼ãã¾ã^^↩