2010/06/27
logoでハローワールド
最近logoの入門書を読んだのでちょっと触ってみました。
たかがハロワの癖に可読性が悪すぎます。
to hello.Next
PenUp
setheading 90
Forward 50
end
to hello.DrawHa
setheading 90
PenUp
Forward 20
Right 120
PenDown
Forward 40
PenUp
Back 40
Left 120
Forward 10
Right 60
PenDown
Forward 40
PenUp
Back 40
Left 60
Back 30
end
to hello.DrawRo
setheading 90
Forward 5
PenDown
repeat 4 [
Forward 40
Right 90
]
PenUp
Back 5
end
to hello.DrawHyphen
setheading 180
Forward 20
Left 90
Forward 5
PenDown
Forward 40
PenUp
Back 45
Right 90
Back 20
end
to hello.DrawWa
setheading 135
Forward 5
Right 45
PenDown
Forward 10
PenUp
Back 10
PenDown
Left 90
Forward 40
PenUp
Back 40
PenDown
arc 90 40
PenUp
Left 135
Forward 5
end
to hello.DrawRu
setheading 90
Forward 20
Right 90
PenDown
Forward 35
PenUp
Right 90
Forward 10
Right 180
PenDown
arc 90 10
PenUp
Forward 10
Left 90
Forward 35
Right 90
Forward 15
Right 90
PenDown
Forward 45
Left 135
Forward 30
PenUp
Back 30
Right 135
Back 45
Left 90
Back 35
end
to hello.DrawDo
setheading 90
Forward 25
Right 90
PenDown
Forward 45
PenUp
Back 25
Left 60
PenDown
Forward 20
PenUp
Back 20
Right 60
Back 20
Left 90
repeat 2 [
Forward 10
Right 45
PenDown
Forward 5
PenUp
Back 5
Left 45
]
Back 45
end
setPenSize 5
HideTurtle ClearScreen Window FullScreen
hello.DrawHa
hello.Next
hello.DrawRo
hello.Next
hello.DrawHyphen
hello.Next
hello.DrawWa
hello.Next
hello.DrawHyphen
hello.Next
hello.DrawRu
hello.Next
hello.DrawDo
たかがハロワの癖に可読性が悪すぎます。
- Category(s)
- junk
- The URL to Trackback this entry is:
- http://dev.ariel-networks.com/Members/uchida/logo30cf30ed30fc30ef30fc30eb/tbping