-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Berkeley Logo Conformity #74
Comments
The color part is easy we can check if the param is Int and set the correct hex from a map
…Sent from my iPhone
On Nov 27, 2018, at 6:43 AM, TheTastefulToastie <[email protected]<mailto:[email protected]>> wrote:
In the Berkeley Logo User Manual<https://people.eecs.berkeley.edu/~bh/usermanual> the commands are implemented as full words and then aliased with shorter two-letter abbreviations and all commands are specified in screaming-case (all uppercase).
* We currently only implement the abbreviated commands.
* The abbreviation for BACK appears to be incorrect (currently bd).
* Uppercase commands are not currently accepted by the interpretor. (Should be case-insensitive?)
* It seems we should also be able to specify colors using the numbers 0-15 (see below).
Excerpt from the Berkeley Logo User Manual
GRAPHICS
Berkeley Logo provides traditional Logo turtle graphics with one turtle.
Multiple turtles, dynamic turtles, and collision detection are not supported.
This is the most hardware-dependent part of Logo; some features may exist
on some machines but not others. Nevertheless, the goal has been to make
Logo programs as portable as possible, rather than to take fullest advantage
of the capabilities of each machine. In particular, Logo attempts to scale
the screen so that turtle coordinates [-100 -100] and [100 100] fit on the
graphics window, and so that the aspect ratio is 1:1.
The center of the graphics window (which may or may not be the entire
screen, depending on the machine used) is turtle location [0 0]. Positive
X is to the right; positive Y is up. Headings (angles) are measured in
degrees clockwise from the positive Y axis. (This differs from the common
mathematical convention of measuring angles counterclockwise from the
positive X axis.) The turtle is represented as an isoceles triangle; the
actual turtle position is at the midpoint of the base (the short side).
However, the turtle is drawn one step behind its actual position, so that
the display of the base of the turtle's triangle does not obscure a line
drawn perpendicular to it (as would happen after drawing a square).
Colors are, of course, hardware-dependent. However, Logo provides partial
hardware independence by interpreting color numbers 0 through 7 uniformly
on all computers:
0 black 1 blue 2 green 3 cyan
4 red 5 magenta 6 yellow 7 white
Where possible, Logo provides additional user-settable colors; how many
are available depends on the hardware and operating system environment.
If at least 16 colors are available, Logo tries to provide uniform
initial settings for the colors 8-15:
8 brown 9 tan 10 forest 11 aqua
12 salmon 13 purple 14 orange 15 grey
Logo begins with a black background and white pen.
TURTLE MOTION
FORWARD dist
FD dist
moves the turtle forward, in the direction that it's facing, by
the specified distance (measured in turtle steps).
BACK dist
BK dist
moves the turtle backward, i.e., exactly opposite to the direction
that it's facing, by the specified distance. (The heading of the
turtle does not change.)
LEFT degrees
LT degrees
turns the turtle counterclockwise by the specified angle, measured
in degrees (1/360 of a circle).
RIGHT degrees
RT degrees
turns the turtle clockwise by the specified angle, measured in
degrees (1/360 of a circle).
SETPOS pos
moves the turtle to an absolute position in the graphics window. The
input is a list of two numbers, the X and Y coordinates.
SETXY xcor ycor
moves the turtle to an absolute position in the graphics window. The
two inputs are numbers, the X and Y coordinates.
SETX xcor
moves the turtle horizontally from its old position to a new
absolute horizontal coordinate. The input is the new X
coordinate.
SETY ycor
moves the turtle vertically from its old position to a new
absolute vertical coordinate. The input is the new Y
coordinate.
SETHEADING degrees
SETH degrees
turns the turtle to a new absolute heading. The input is
a number, the heading in degrees clockwise from the positive
Y axis.
HOME
moves the turtle to the center of the screen. Equivalent to
SETPOS [0 0] SETHEADING 0.
ARC angle radius
draws an arc of a circle, with the turtle at the center, with the
specified radius, starting at the turtle's heading and extending
clockwise through the specified angle. The turtle does not move.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub<#74>, or mute the thread<https://github.com/notifications/unsubscribe-auth/ABZ1YMJhcrwC0-E9eCsKGvb3NPLcy4Sjks5uzU-hgaJpZM4Y1oq8>.
|
Yes, in addition to that it should probably only allow positive integers.
I see no reason to limit it, we can easily provide an unlimited number of user-definable colors. We would also need to implemented the
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In the Berkeley Logo User Manual the commands are implemented as full words and then aliased with shorter two-letter abbreviations and all commands are specified in screaming-case (all uppercase).
BACK
appears to be incorrect (currentlybd
).Excerpt from the Berkeley Logo User Manual
GRAPHICS
Berkeley Logo provides traditional Logo turtle graphics with one turtle.
Multiple turtles, dynamic turtles, and collision detection are not supported.
This is the most hardware-dependent part of Logo; some features may exist
on some machines but not others. Nevertheless, the goal has been to make
Logo programs as portable as possible, rather than to take fullest advantage
of the capabilities of each machine. In particular, Logo attempts to scale
the screen so that turtle coordinates [-100 -100] and [100 100] fit on the
graphics window, and so that the aspect ratio is 1:1.
The center of the graphics window (which may or may not be the entire
screen, depending on the machine used) is turtle location [0 0]. Positive
X is to the right; positive Y is up. Headings (angles) are measured in
degrees clockwise from the positive Y axis. (This differs from the common
mathematical convention of measuring angles counterclockwise from the
positive X axis.) The turtle is represented as an isoceles triangle; the
actual turtle position is at the midpoint of the base (the short side).
However, the turtle is drawn one step behind its actual position, so that
the display of the base of the turtle's triangle does not obscure a line
drawn perpendicular to it (as would happen after drawing a square).
Colors are, of course, hardware-dependent. However, Logo provides partial
hardware independence by interpreting color numbers 0 through 7 uniformly
on all computers:
Where possible, Logo provides additional user-settable colors; how many
are available depends on the hardware and operating system environment.
If at least 16 colors are available, Logo tries to provide uniform
initial settings for the colors 8-15:
Logo begins with a black background and white pen.
TURTLE MOTION
FORWARD dist
FD dist
BACK dist
BK dist
LEFT degrees
LT degrees
RIGHT degrees
RT degrees
SETPOS pos
SETXY xcor ycor
SETX xcor
SETY ycor
SETHEADING degrees
SETH degrees
HOME
ARC angle radius
The text was updated successfully, but these errors were encountered: