Logoåºç¤ææ³æéãã¹ã¿ã¼ :çºåç·¨
çºåç·¨ã¯ãå®è·µç·¨ã§ããæ¥è§¦ç·¨ãããªãããã¢ãã¯ã ã£ãã®ã§ãçºå編㯠æ®éã«æéãã¹ã¿ã¼ãç®æãã¾ããã
ä»ã®è¨èªãããç¨åº¦ç¥ã£ã¦ãã人ã¯ãããèªãã° Logo ã®åºç¤ããã¹ã¿ã¼ã㦠Logo ãæ¸ããã¨ãã§ããããã«ãªãã¾ããå¼ããªããéãã§ãã ããã¾ãã
æ¬ã¨ã³ããªã¼ã¯ MSW Logo ã§åä½ç¢ºèªãã¦ãã¾ããLispåæ§ Logo ã¯æ¹è¨ãæ¿ããã®ã§ãä»ã®å¦çç³»ã§ã¯åããªãã£ããããããã§ãããããã¸ãã¯ã容赦ã
ã³ã¡ã³ã
ã³ã¡ã³ã㯠Lispåæ§ ã»ãã³ãã³ã;ãã§ä¸è¡ã³ã¡ã³ãã«ãªãã¾ãã
;ãã®è¡ã¯ã³ã¡ã³ã print "hello ;ãã以éãè¡æ«ã¾ã§ã³ã¡ã³ã
èªï¼= ã·ã³ãã«ï¼
Logo ã®ããã°ã©ã ãæ§æããæå°ã®è¦ç´ ã¯ã èª(word) 㨠ãªã¹ã(list) ã§ãã èªã¯ ããããã·ã³ãã«ï¼ã·ã³ãã«ã«é¦´æã¿ã®ãªãããã¯æååãªãã©ã«ã¿ãããªãã®ã¨æãããï¼ããªã¹ã㯠[] ã§å²ã¾ãã空ç½åºåãã® é åã§ãã
èªã¯
- ãèªãããã®ã¾ã¾æ¸ããã¨ã㯠ããè¨ãååã®é¢æ°ãå®è¡ããã
- ã"èªãã¨ã¯ã©ã¼ãããã¨ãã¯ãã·ã³ãã«ãã®ãã®ãå·®ãï¼æååãªãã©ã«ã®ããã«æ±ãï¼
- ã:èªãã¨æ¸ããå ´åã¯ãããè¨ãååã®å¤æ°ã«æç¸ãããå¤ãåå¾ãã
ã¨è¨ã風ã«ä½¿ãã¾ãã以ä¸ã¯æªå®ç¾©ã® hoge ã«å¯¾ãã¦ããããããã£ã¦ã¿ãã¢ã
>>hoge I don't know how to hoge ;hoge ãªãã¦é¢æ°ãããªããï¼ >>"hoge You don't say what to do with hoge ;ãã®ãhogeãã£ã¦å¤ãã©ããããããã®ï¼ >>:hoge hoge has no value ; hoge ã¯å¤ãæã£ã¦ã¾ããï¼
ãã¨ãæ°å¤èªï¼æ°åæååï¼ã ãã¯ã¡ãã£ã¨ç¹æ®ã§ããèªãããã®ã¾ã¾æ¸ããã¨ãããã¯ã©ã¼ãããã¦ãããã¨ãã ãæé»ã®ã¯ã©ã¼ããã¨ããç¹å¥ã«ã¼ã«ãããã¾ãã
>>42 You don't say what to do with 42
åå¿ã "hoge ã®æã¨ä¸ç·ã§ããï¼æ°åã ãã®é¢æ°åã¯ç¡ãã®ã§ãã¯ã©ã¼ãããªãã¦ãæ°å¤ãªãã©ã«ã¿ããã«æ±ããã®ç¹å¥ã«ã¼ã«ã¯ä¾¿å©ã§ãã
æç¶ãï¼= é¢æ°ï¼
ããã¾ã§ãé¢æ°ãã¨è¨ã£ã¦ãã¾ã£ãã¢ãã ããã©ãLogo ã§ã¯ãã³ãã¯ãæç¶ããã¨å¼ã³ã¾ããæ£ç¢ºã«ã¯ãæ»ãå¤ã®ããé¢æ°ã ãªãã¬ã¼ã·ã§ã³(operation)ãæ»ãå¤ã®ç¡ãé¢æ°ã ã³ãã³ã(command) ãã³ãã³ãã¨ãªãã¬ã¼ã·ã§ã³ãç·ç§°ãã¦ãæç¶ããã§ãã
è©ä¾¡çµæã ä»ã®æç¶ãã®å¼æ°ã¨ãªãããã®ã¯ãªãã¬ã¼ã·ã§ã³ã ãã§ããããã¬ãã«ã«æ¸ããã®ã¯ å³å¯ã«ã¯ ã³ãã³ãã ãã§ãï¼è¦åãããã ãã§ãããã©ï¼ãè¯ãããããã°ã©ãã³ã°è¨èªã®ãå¼ãã¨ãæãã®é¢ä¿ã§ããã
å®ã¯Logoã®ããã°ã©ã ã§ãããã¬ãã«ã«æ¸ããã®ã¯ã³ãã³ãï¼ã¤ã¾ããæãï¼ã ããªã®ã§ããªãã¬ã¼ã·ã§ã³ãå¤ï¼ï¼ãå¼ãï¼ãæ¸ãã¡ãã㨠æããã¾ãï¼ãã£ãããåºã¦ããè¦åãYou don't say what to do with ãã ã¯ãå¼ããããã¬ãã«ã§å®è¡ãã¡ãã£ãã¨ãã«åºãè¦åæã§ãï¼ã
Logo ã¯ãååçã«å ¨ã¦ã æç¶ã ã¨ãã¦å®è£ ããã¦ãã¾ããæ®éã®ããã°ã©ãã³ã°è¨èªã§ã¯ãæ§æãã§å®ç¾ããããªãã®ââå¤æ°ã®çæããæ¡ä»¶åå²æ§æãå復æ§æ ã¿ãããªã®ãã®ã¾ã§ æç¶ã ãªãã§ãããããã§ãããã
Logo ã®æç¶ãå¼åºã¯ãå¼æ°ãªã¹ãã®æ±ããã¡ãã£ã¨ç¬ç¹ã§ã
>>sum 1 2 3
ã¿ããã«ã«ãã³ã§æ¬ã£ãããã¾ããããã㯠sum ã¨ããæç¶ãã®å¼åºã§ããã sum 㯠2ã¤ã®å¼æ°ãåã ã¨ããå®ç¾©ãããã©ãã¾ã§ãå¼æ°ãªã®ããLogoå¦çç³»ãæ¨è«ãã¦ãã¾ããã ããã
>>print sum 1 2 ; print(sum(1, 2)); ã¨è§£é 3 >>print 42 sum 1 2 ; print(42); sum(1,2); ã¨è§£é 42 You don't say what to do with 3
ã¿ããã«åãã¾ãã
ãªã¹ã
ãªã¹ãã¯ããã¼ã¿ã®é åã表ç¾ãããã空ç½æ··ããæååã表ç¾ããããããã°ã©ã ã表ç¾ãããã«ä½¿ãã¾ããLispã®ãªã¹ãç±æ¥ãªã®ã§ãã¡ãããåããªãã°ç解ã¯æ©ãã§ã(Lisp ã® ãªã¹ãæä½ã¨ã®å¯¾å¿ã¯ æ¥è§¦ç·¨ãã覧ãã ãã)ã
>>[1 2 3 4] You don't say what to do with [1 2 3 4]
ãªã¹ããããã°ã©ã ã¨ãã¦å®è¡ããã«ã¯ãrunæç¶ã ã使ãã¾ãã
>>run [print [hello world]] hello world
æ¨æºå ¥åºå
æ¨æºåºåã«ã¯ printæç¶ã ã使ãã¾ããã¯ã©ã¼ãèªããã®ã¾ã¾æååã¨ãã¦åºåãã¾ãã
>>print "hogehoge hogehoge
ãã ãã¯ã©ã¼ãèªã¯ç©ºç½ã§åãã¦ãã¾ãã®ã§ã空ç½ãå«ãæååã®å ´å㯠ãªã¹ãã使ãã¾ãï¼Logo ã«ã¯ Cç³»è¨èªã®"hoge piyo" ã«ç¸å½ãã æååãªãã©ã« ã¯ãæ®å¿µãªããããã¾ããï¼ã
>>print [hoge hoge piyo piyo] hoge hoge piyo piyo
æ¨æºå ¥å㯠readchar ã¾ã㯠readlist ã使ãã¾ããreadchar ã¯ä¸æåãreadlist ã¯è¤æ°æåã®å ¥åãåãä»ãã¾ãã
>>readlist
MSW Log ã®å ´åããã®ãããªã¤ã³ãããããã¯ã¹ãéãã
You don't say waht to do with [abc def gh i]
ã®ããã«å
¥åããã¾ãã
æç¶ãã®å®ç¾©
æç¶ãã®å®ç¾©ã¯ to ã end ã使ãã¾ãã
to increment :arg output :arg + 1 end
ãoutputã 㯠Smalltalk ã§ããã¨ããã®ã^ããCç³»è¨èªã§ã®ãreturnãã§ãã
>>print increment 42 43
ä½è«ã§ãããto ã end ã¯ãLogo ã®æ§æããããã¨ããªãã¤ã¬ã®ã¥ã©ã¼ã§ãææ³ï¼ã¨é¦ãããããã¨ãããããã¾ããtoæç¶ãï¼æåã®ä¸è¡ï¼ãå®è¡ããã¨ã以éã 対話åããã°ã©ãã³ã°ã§èãã¦ããå½¢ã§å®è£
ããã¦ãããï¼ã¾ã㧠VisualStudio ã¨ãã®ã¦ã£ã¶ã¼ãã®ãããªæ±ãã§ãï¼ãªã©ããã¡ãã£ã¨æµ®ãããæ触ã®å®è£
ãå¤ãã§ãã
å¤æ°ã®å®ç¾©ã»ä»£å ¥
å¤æ°ã«å¤ãä»£å ¥ããå ´å㯠make æç¶ã ã使ãã¾ãã
>>make "hoge 42 >>print :hoge 42
hoge ãã¯ã©ã¼ããã¦æ¸ããªãã¡ããããªãã®ã¯ããããæç¶ãï¼é¢æ°ï¼ã ãããå¼æ°ã§ãããããååã®ãã¨æ¸¡ãã®ã§ãæç¶ããå¤æ°ã¨ãã¦è©ä¾¡ããã¡ãã¾ããã¨ããããã
makeã®å®è¡æã« hoge ã¨ããå¤æ°ãã¾ã åå¨ããªããã°ãmake ã¯ã°ãã¼ãã«ã¹ã³ã¼ãã«å¤æ°ãä½ãã¾ãã
to fooVarMake make "foo 42 end
>>print :foo foo has no value >>fooVarMake >>print :foo 42
ãããªæãããã¼ã«ã«å¤æ°ãä½ãã«ã¯ localmake æç¶ãã使ãã¾ãã
to barVarLMake localmake "bar 50 end
>>print :bar bar has no value >>barVarLMake >>print :bar bar has no value
ãã ããLogo ã®å¤æ°ã¯ ãã¤ãããã¯ã¹ã³ã¼ãã§ãããã¨ã«æ³¨æãã¦ãã ããããã¤ãããã¯ã¹ã³ã¼ãã¨ã¯ãã½ã¼ã¹ã³ã¼ãã®æ§æã®ãã¹ãã§ã¯ãªããé¢æ°ã®å¼åºã¹ã¿ãã¯ã®ãã¹ããã¹ã³ã¼ãã¨ãªãã¾ãã
to printBuz print :buz end to executePrintBuz :msg localmake "buz :msg printBuz end
>>print :buz buz has no value >>printBuz buz has no value in printBuz [print :buz] >>executePrintBuz "hello hello >>print :buz buz has no value
printBuz ã executePrintBuz ããã³ã¼ã«ããã¨ãã ããexecutePrintBuz ã®ãã¼ã«ã«å¤æ° buz ãè¦ãã¦ããããã§ããã
æ¡ä»¶åå²ã»å復
Logo 㯠Lisp ãªã®ã§ãå¶å¾¡æ§é ã ã£ã¦ æç¶ãã¨ãã¦å¥½ãã«ä½ããã¨ãåºæ¥ã¾ããããã§ç´¹ä»ããå¶å¾¡æ§é ã Logo ã®æç¶ãã®ä¸ç¨®ã«éãã¾ããã
ã¾ãã¯ãif 㨠ifelse æç¶ãã
>>make "hoge 3 >> if :hoge > 1 [rint "true] true >> ifelse :hoge < 1 [print "true] [print "false] false
å復æç¶ã repeat 㨠whileã
>>repeat 3 ["hello] hello hello hello >>make :x = 5 >>while [x > 0] [print "hello make "x :x - 1] hello hello hello hello hello
ã¿ã¼ãã«ã°ã©ãã£ãã¯ã¹
è¦ã¦ããã¨ãããLogo 㯠æ±ç¨ã¹ã¯ãªããè¨èªãªã®ã§ãããããã¯æãããªããªã£ã¦ãã¾ã£ãã®ã¯ãã¿ã¼ãã«ã°ã©ãã£ãã¯ã¹ãããã¾ãã«å°è±¡æ·±ãããã§ãã
ãè¨èªãã¨ããç®ã§è¦ãã¨ãåºç¤ææ³ï¼ãã¨æãã®ã§ãããã¿ã¼ãã«ã°ã©ãã£ãã¯ã¹ããªãLogoã¯ãã¾ã㧠Tk ã®ãªã Tcl ã®ãããªãã®ããããç¡ãã£ã¡ãå§ã¾ãã¾ããã»ã»ã»ã¨ãããã¨ã§ã
* * *
ã¿ã¼ãã«ã°ã©ãã£ãã¯ã¯ããã³ãæã£ããã¼ã ç¶ã®ãããããã¿ã¼ãã«ããã³ã³ãã¥ã¼ã¿ããå¶å¾¡ãããç©ä½ã¿ã¼ãã«ï¼åºã¿ã¼ãã«ï¼ãã¨ãããã ãã©ã¦ã³ç®¡ä¸ã«ã·ãã¥ã¬ã¼ããã ãç»åï¼å ç·ã®ã¿ã¼ãã«ï¼ãã®äºã¤ãããã®ã§ãããå¾è ã°ã£ãããæåã«ãªã£ã¦ããªãã ããçµµããã½ããã®ããã«èª¤è§£ããã¦ããæããããã¾ãã
ããã¼ãå çã³ã¡(?) ã«ãã£ã ç©ä½ã®ãã¿ã¼ãã«ãã¯ãè¤æ°å°å¶å¾¡ãããã¨ãã§ããç©ä½ã ãã«ãã«ãã¼ã¶ã¼ã®ãããªéã³æ¹ãåºæ¥ãããã§ãããã¯åãæãããã§ããèµ°ããã¦éãã§ãè¯ããåºã«ãçµµããããã¦ãè¯ããããã羨ã¾ãããªããããªç´ æµä½é¨ããã¦ã¿ãããã®ã§ãã
LOGO 1968 -BBN Timeline
ã¿ã¼ãã«ã¯ãåºæ¬çã« forwardï¼åé²ï¼ãbackï¼å¾éï¼ãleftï¼å·¦æåï¼ãrightï¼å³æåï¼ã¨ pendownï¼ãã³ãä¸ããï¼ãpenupï¼ãã³ãä¸ããï¼ã¨ããåä½ããã§ãã¾ãããç»é¢ç³»ã®ã³ãã³ãã¨ãã¦ãcleanï¼ç·ãæ¶ãï¼ãclearscreenï¼ç·ãæ¶ãã¦ã¿ã¼ãã«ãåæä½ç½®ï¼ç»é¢ä¸å¤®ï¼ã«æ»ã ãããã¾ãã
ãããã³ãã³ãã¯ç縮åããã£ã¦ã移åç³»ã fdãbkãltãrtããã³æä½ç³»ã pdãpuãclearscrean ã cs ã«ãªãã¾ãã
>>fd 100 rt 120 fd 100 rt 120 fd 100 >>pu fd 100 pd >>fd 100 rt 120 fd 100 rt 120 fd 100 >>pu fd 100 pd >>fd 100 rt 120 fd 100 rt 120 fd 100
left(lt) right(rt) ã®å¼æ°ã¯ è§åº¦ã§ããforward(fd), back(bk) ã®å¼æ°ã¯ 移ååä½ã§ãæ®éã¯ã¹ã¯ãªã¼ã³ã®ãããã«å¯¾å¿ãã¾ããè¶ ç°¡åã§ãã
ãã¦ãã¿ã¼ãã«ã¯åé²å¾éã¨æåã®ã¿ãåºæ¥ã¾ããããã®ãããªèªåã®å§¿å¢ãä¸å¿ã¨ãã å¹¾ä½å¦ãã ããã¼ãå çã¯ãã¿ã¼ãã«å¹¾ä½å¦ãã¨å¼ã³ã¾ããã
座æ¨ç³»ã§èãããæ®éï¼ã«æãããã¦ããï¼ãã®ããããã«æ¯ã¹ãã¿ã¼ãã«å¹¾ä½å¦ã¯èªèº«ã«ç½®ãæãã¦èããããï¼ï¼ã¤ã¡ã¼ã¸ã§ããï¼ãã¨ã§ã容æã«å¦ç¿ã§ãã¾ããæ®éã®å¹¾ä½å¦ã§ã¯ å³å½¢ãæ¸ãæ¹ç¨å¼ã«èª¤ãããã£ãå ´åãã©ããæªãã£ãã®ããæ¤è¨¼ããã®ã¯å¤§å¤æ·å± ãé«ãã®ã§ãããã¿ã¼ãã«å¹¾ä½å¦ã®å ´åããã¿ã¼ãã«ã«ãªã£ãã¤ããã§ãã³ãã³ãããªãããã¿ã¼ãã«ãã£ãããããã°ç°¡åã«ãã°ãç¹å®ã§ãã¾ããè¯ãä¾ã«ãããã®ãã
fd 100 rt 60 fd 100 rt 60 fd 100
ãä¸è§å½¢ã«ãªããªããã¨ãããã°ã
ãä¸è§å½¢ã®å ç©ã®åã¯180°ãã¨ããç¥èã«ã¤ããã¦ãã¤ããããæ¸ãã¦ãã¾ããã¡ã§ãã
ããã辺ã®è©±ã¯ ç®ããé±ãªã¨ãã½ã¼ããæºè¼ã® ãã¤ã³ãã¹ãã¼ã ã大å¤ããããããã®ã¨ã³ããªã¼ãèªãã§ãã¾ããã㪠ã³ã³ãã¥ã¼ã¿ã¨ããã°ã©ãã³ã°ã好ããªæ¹ãªã æ¯éæ¯é èªãã§ã¿ã¦ãã ããã絶対æã¯ãã¾ããã§ããï¼
ãã¤ã³ãã¹ãã¼ã âåä¾ãã³ã³ãã¥ã¼ã¿ã¼ãããã¦å¼·åãªã¢ã¤ãã¢
- ä½è : ã·ã¼ã¢ã¢ããã¼ã,Seymour Papert,奥æè²´ä¸å
- åºç社/ã¡ã¼ã«ã¼: æªæ¥ç¤¾
- çºå£²æ¥: 1995/03/01
- ã¡ãã£ã¢: åè¡æ¬
- è³¼å ¥: 3人 ã¯ãªãã¯: 64å
- ãã®ååãå«ãããã° (19件) ãè¦ã
ã¿ã¼ãã«å¹¾ä½å¦ã¨ããã°ããã¿ã§ãããå æ¥çºå£²ãããã¬ã³ã¿ã«ãã®ã« ã®ç¬¬ä¸é¨åå·»ã§ãäºé¨ã®æå¾ã§åãå¤§å¹ ã«å¤±ã£ããã¤ãåããèªå·±ã®è² è·ã軽æ¸ããæ°ããæ¹æ³ã¨ãã¦ãæ¦éæ示ã èªåãä¸å¿ã¨ãã座æ¨ã«åãæ¿ããæåãããã¾ãããããã¿ã¼ãã«ã ããã¨æã£ã¦ãã¾ãã¾ããã
ã¬ã³ã¿ã«ãã®ã« éã®é¨å£«ã¨éæ³ä½¿ã (è§å·ã¹ãã¼ã«ã¼æ庫)
- ä½è : ä¸ç°èª ,pako
- åºç社/ã¡ã¼ã«ã¼: è§å·æ¸åº(è§å·ã°ã«ã¼ããããªãã·ã³ã°)
- çºå£²æ¥: 2010/02/01
- ã¡ãã£ã¢: æ庫
- è³¼å ¥: 3人 ã¯ãªãã¯: 59å
- ãã®ååãå«ãããã° (35件) ãè¦ã
ããã«ãã¦ãã¬ã³ã¿ã«ãã®ã«ã第äºé¨ã®ã¢ãã¡åã¯ããªãã®ã§ããããããªã«ãããã¨ããã§(ryãã ã¨ãã®æ°ãã£ã©ããå½±å´ããã®é©å¤©åå°ã®éæ³ããæ¯éæ¯é åç»ã§è¦ããã§ããé話ä¼é¡ã
ãã¦ãããã¯ããã¤ã¤ã¿ã¼ãã«ã«ä»»æã®åº§æ¨ã«ç§»åãããããç¾å¨ã®åº§æ¨ãåå¾ãããããã³ãã³ããããã¾ãã*1
>>setpos [20 30] ;ã¿ã¼ãã«ã®ä½ç½®ã (20, 30) ã«ã»ãã >>setx 50 ;ã¿ã¼ãã«ã®X座æ¨ã 50 ã«ã»ãã >>sety 60 ;ã¿ã¼ãã«ã®X座æ¨ã 60 ã«ã»ãã >>pos ;ã¿ã¼ãã«ã®åº§æ¨ãåå¾ You don't say what to do with [50 60] >>setheading 90 ;ã¿ã¼ãã«ã®åããè§åº¦ã§è¨å® >>heading ;ã¿ã¼ãã«ã®åããåå¾ï¼è§åº¦ï¼ You don't say what to do with 90 >>towards [10 20] ;ã¿ã¼ãã«ãå¼æ°åº§æ¨ã«åããã¨ãã®è§åº¦ You don't say what to do with 233.130102354156
ãããã¯ãã¿ã¼ãã«ã°ã©ãã£ãã¯çã«ã¯ã¡ãã£ã¨éªéã§ãã
* * *
以ä¸ã§ã¿ãªãããã
ã¿ãããªã®ã æ¸ããããã«ãªã£ã¦ããããºã§ããã»ã»ã»ãã¶ãã
*1:ã¿ã¼ãã«ã°ã©ãã£ãã¯ã¹ã®å ´åã座æ¨ã®åç¹ãç»é¢ä¸å¤®ï¼ã¿ã¼ãã«ã®åæä½ç½®ï¼ã§ãããã¨ã«æ³¨æãã¦ãã ãã