- このサイトに書かれていることは間違っているかもしれませんので、ご注意ください。
- 非推奨環境: フォントの大きさが Unreadable な xterm 上のテキストブラウザ
2005][07][08][09][10][11][12][
2006][01][02][03][04][05][06][07][08][09][10][11][12][
2007][01][02][03][04][05][06][07][08][09][10][11][12][
2008][01][02][03][04][05][06][07][08][09][10][11][12][
2009][01][02][03][04][05][06][07][08][09][10][11][12][
2010][01][02][03][04][05][06][07][08][09][10][11][12][
2011][01][02][03][04][05][06][07][08][09][10][11][12][
2012][01][02][
2006][01][02][03][04][05][06][07][08][09][10][11][12][
2007][01][02][03][04][05][06][07][08][09][10][11][12][
2008][01][02][03][04][05][06][07][08][09][10][11][12][
2009][01][02][03][04][05][06][07][08][09][10][11][12][
2010][01][02][03][04][05][06][07][08][09][10][11][12][
2011][01][02][03][04][05][06][07][08][09][10][11][12][
2012][01][02][
2009年30週207日星期0 12:00:00 AM 00:00:00
■[PostScript]どう書く.org 
以前書いたローレンツアトラクタをどう書く.org に投稿してみた。
参考ページに以前書いたときの URL を書いておいたのだけど、ページタイトルを空欄にしてしまい、リンクがたどりにくい物になってしまった。
■[PostScript]ラングトンの蟻 
わくわくパズルランド (岩波ジュニア新書) の「一歩進んで曲がる」や XScreenSaver の Ant は「ラングトンの蟻」と呼ばれるものだという事を おそらくはそれさえも平凡な日々: JavaScriptでラングトンの蟻 で知った記念で、PostScript でラングトンの蟻を書いてみた。
追記 : これもどう書く.org に投稿してみました
余談ですが、わくわくパズルランド (岩波ジュニア新書) には BASIC 版プログラムが掲載されています。
以下ソース。
%!PS gsave 0 dict begin /fieldsize 100 def /white [1 1 1] def /field [ fieldsize{ [fieldsize{ white }repeat] }repeat ] def /check-mark{ % ant -- bool begin field position-x get position-y get color eq end }def /draw-mark{ % ant -- begin field position-x get position-y color put end }def /erase-mark{ % ant -- begin field position-x get position-y white put end }def /generate-ant{ % init-x init-y direction-x direction-y color -- dict 5 dict begin /color exch def /direction-y exch def /direction-x exch def /position-y exch def /position-x exch def currentdict end }def /move{ % ant -- begin /position-x position-x direction-x add def /position-y position-y direction-y add def end }def /turn-left{ % ant -- begin direction-y neg direction-x /direction-y exch def /direction-x exch def end }def /turn-right{ % ant -- begin direction-y direction-x neg /direction-y exch def /direction-x exch def end }def /draw-field{ 2 2 scale 0 1 fieldsize 1 sub{ % x 0 1 fieldsize 1 sub{ % x y field 2 index get 1 index get aload pop setrgbcolor 2 copy 1 1 rectfill pop }for pop }for showpage }def /ant1 fieldsize 2 idiv dup 0 1 [0 0 0] generate-ant def 0 1 20000{ ant1 dup check-mark{ dup erase-mark dup turn-right move }{ dup draw-mark dup turn-left move }ifelse ant1 begin position-x dup 0 lt exch fieldsize ge or position-y dup 0 lt exch fieldsize ge or or end { exit }if % 20歩毎に表示 20 mod 0 eq{ draw-field }if }for end grestore
コメントを書く
トラックバック - http://d.hatena.ne.jp/yshl/20090726
2005)(07)(08)(09)(10)(11)(12)(
2006)(01)(02)(03)(04)(05)(06)(07)(08)(09)(10)(11)(12)(
2007)(01)(02)(03)(04)(05)(06)(07)(08)(09)(10)(11)(12)(
2008)(01)(02)(03)(04)(05)(06)(07)(08)(09)(10)(11)(12)(
2009)(01)(02)(03)(04)(05)(06)(07)(08)(09)(10)(11)(12)(
2010)(01)(02)(03)(04)(05)(06)(07)(08)(09)(10)(11)(12)(
2011)(01)(02)(03)(04)(05)(06)(07)(08)(09)(10)(11)(12)(
2012)(01)(02)(
2006)(01)(02)(03)(04)(05)(06)(07)(08)(09)(10)(11)(12)(
2007)(01)(02)(03)(04)(05)(06)(07)(08)(09)(10)(11)(12)(
2008)(01)(02)(03)(04)(05)(06)(07)(08)(09)(10)(11)(12)(
2009)(01)(02)(03)(04)(05)(06)(07)(08)(09)(10)(11)(12)(
2010)(01)(02)(03)(04)(05)(06)(07)(08)(09)(10)(11)(12)(
2011)(01)(02)(03)(04)(05)(06)(07)(08)(09)(10)(11)(12)(
2012)(01)(02)(
◎227684◎
