Saturday, 14 February 2015

HB Blog 58: Logo Programming Basic.

Logo is an educational programming language, designed in 1967 by Daniel G. Bobrow, Wally Feurzeig, Seymour Papert and Cynthia Solomon. Logo is a multi-paradigm adaptation and dialect of Lisp, a functional programming language. It is the most interesting programming language for children to learn. It was my first programming language and personally speaking I liked the turtle. Basically, the environment goes like a terminal with screen and terminal at bottom. The screen has turtle(robot logo) which is like our starting point or say mouse pointer. As we provide commands in terminal appropriate actions are performed by this turtle.

Following are few basic commands,
fd - It moves turtle forward command with specific units
bk - It moves turtle backward command with specific units
rt - It moves turtle right command with specific units
lt - It moves turtle left command with specific units
cs - It clears the screen.
repeat - It repeats the commands.
pu - It pen up the turtle which makes turtle to stop writing
pd - It pen down the turtle which makes turtle to start writing
ht - It makes turtle hide
st - It makes turtle visible
home - It causes the turtle to return to the center of the screen
label - It takes a single word as a quoted string and print them on the graphics window at the location of the turtle
setxy - It takes two arguments, treats the first as the value of the abscissa (horizontal axis) and the second as a value of the ordinate (vertical axis)
make - It takes a single word as a local variable to contain value.
print - It prints given values.
random - It prints random values.
to - It starts the command loop.
end - It ends the command loop.

Have a look on a code snippets, which will draw a simple box,
1
2
3
4
5
forward 100
right 90
forward 100
right 90
fd 100 rt 90 fd 100 rt 90

No comments:

Post a Comment