version 0.144
User
defined
buttons
GrafX
grafx rectangle circle move
Use the start button to start turtle graphics and drawing.
Use the game button to play the sample game from the tutorial.
Use the info button to read the tutorial and reference sections.
Type in the commands text box to run the Forth/PostScript interpreter.
The buttons for the instructions and reference sections will appear below the command line area
Use the button size button to toggle between smartphone finger size and regular computer size.
Background Stroke Fill Buttons
AliceBlue | AntiqueWhite | Aqua | |||
AquaMarine | Azure | Beige | |||
Bisque | Black | BlanchedAlmond | |||
Blue | BlueViolet | Brown | |||
BurlyWood | CadetBlue | Chartreuse | |||
Chocolate | Coral | CornflowerBlue | |||
Cornsilk | Crimson | Cyan | |||
DarkBlue | DarkCyan | DarkGoldenRod | |||
DarkGray | DarkGreen | DarkKhaki | |||
DarkMagenta | DarkOliveGreen | DarkOrange | |||
DarkOrchid | DarkRed | DarkSalmon | |||
DarkSeaGreen | DarkSlateBlue | DarkSlateGray | |||
DarkTurquoise | DarkViolet | DeepPink | |||
DeepSkyBlue | DimGray | DodgerBlue | |||
FireBrick | FloralWhite | ForestGreen | |||
Fuchsia | Gainsboro | GhostWhite | |||
Gold | GoldenRod | Gray | |||
Green | GreenYellow | HoneyDew | |||
HotPink | IndianRed | Indigo | |||
Ivory | Khaki | Lavender | |||
LavenderBlush | LawnGreen | LemonChiffon | |||
LightBlue | LightCoral | LightCyan | |||
LightGoldenRodYellow | LightGray | LightGreen | |||
LightPink | LightSalmon | LightSeaGreen | |||
LightSkyBlue | LightSlateGray | LightSteelBlue | |||
LightYellow | Lime | LimeGreen | |||
Linen | Magenta | Maroon | |||
MediumAquaMarine | MediumBlue | MediumOrchid | |||
MediumPurple | MediumSeaGreen | MediumSlateBlue | |||
MediumSpringGreen | MediumTurquoise | MediumVioletRed | |||
MidnightBlue | MintCream | MistyRose | |||
Moccasin | NavajoWhite | Navy | |||
OldLace | Olive | OliveDrab | |||
Orange | OrangeRed | Orchid | |||
PaleGoldenRod | PaleGreen | PaleTurquoise | |||
PaleVioletRed | PapayaWhip | PeachPuff | |||
Peru | Pink | Plum | |||
PowderBlue | Purple | Red | |||
RosyBrown | RoyalBlue | SaddleBrown | |||
Salmon | SandyBrown | SeaGreen | |||
SeaShell | Sienna | Silver | |||
SkyBlue | SlateBlue | SlateGray | |||
Snow | SpringGreen | SteelBlue | |||
Tan | Teal | Thistle | |||
Tomato | Turquoise | Violet | |||
Wheat | White | WhiteSmoke | |||
Yellow | YellowGreen |
The goal of this project is to help your childen learn computer programming.
We have already written the software. We need your support to add the graphics and design needed to make this project child-friendly and child-accessible.
STEM (Science, technology, Engineering, and Mathematics) are critical skills for success in the future job market.
Even the U.S. Navy is promoting the importance of STEM (You dont want to get into a career where theres no openings. Answering the call of todays Navy and Marine Corps by capturing the imagination of today's young people, creating opportunities for them to explore their passion and discover new interests where they can excell.).
The good paying jobs of the future will require skill and ability at mathematics and computer technology.
Children who dont learn these valuable skills will be stuck in poor paying jobs or even struggle to find any job at all.
In the 1970s, the world famous Massachusetts Institute of Technology (M.I.T.) came up with turtle graphics. Turtle graphics was proven in classrooms worldwide to be a highly effective method for teaching children the basic concepts of computer programming and mathematics.
Turtle graphics even proved useful for adults, helping upper division and graduate students at M.I.T. visualize and learn advanced mathematical concepts.
We have updated this time-proven technology and brought it to the web-browser, where children from families of any income level can experiment and learn from almost any modern device (smart phones, tablets, computers) at home, at school, and even at public libraries.
Help us help your children have a promising future.
Self-contained educational software. This is a self-contained educational program that can be used for free on a wide variety of machines to teach computer programming and mathematics. While students can use this program directly from the website (on almost any modern computing device), schools, teachers, parents, and students can download the free source code and modify it freely under the M.I.T. license. Because the instructions are in ordinary HTML, schools and teachers can easily modify or replace the instructional materials with their own course materials while keeping the full working software.
Free open source educational and fun software. Classic and modern programming tools moved into the web browser. You can run this free open source software on almost any smart phone (iOS, Android, Blackberry, or Windows Mobile), almost any tablet (iOS, Android, or Windows), and almost any laptop or desktop computer (Windows, Macintosh, Linux, BSD, Solaris, etc.).
Six step educational course. The starting steps of turtle graphics use time-tested educational methods developed by the Massachusetts Institute of Technology (M.I.T.). Turtle graphics were originally developed for teaching elementary school students, but have since been used for all grades, up to and including college students. The middle part of the starting steps covers the basics of mathematics and computer programming. This is not a detailed and complete course designed for professional programmers, but just enough of the basics that students of all ages can be successful. The starting steps conclude with an opportunity to build a real working computer game. Having a fun goal helps engage students, especially younger students. The classic game Breakout is used as an example because although it is a very simple game from the early days of computing, it does include most of the major features found throughout the gaming industry.
Use buttons to learn turtle graphics. The classic, time-tested M.I.T. system for teaching children and college students the principles of mathematics and computer prorgamming.
Automate your drawings. Learn how to build sequences of steps that will make the computer draw complicated pictures for you.
Build your own calculator and learn about stacks. Learn about RPN (Reverse Polish Notation) and computer stacks. Use this knowledge to make your own personal customized calculator.
Learn how to program computers. Learn the basics of programming and data structures so that you can build your own tech.
Learn how to build your own version of the classic Breakout game. Step by step build this classic game by using the knowledge you learned in the previous steps.
Build your own games. Now have fun and let your imagination go wild and build computer games for yourself and friends.
Goal: Your goal is to draw a picture or pictures using Turtle GrafX. It takes a little getting used to, but once you figure out how to plan your steps, you will be using the exact smae kind of reasoning that is used for building computer programming algorithms.
Most children enjoy experimenting and finding out on their own how to use the Turtle to draw pictures. You wont ruin anything, although you might accidentally erase one of your pictures.
If you need instructions, step-by-step instructions follow.
Push the start button to get started:
then scroll up and draw
If you are using a mobile device, you may want to click on the large button labelled button size. This will make all of the buttons finger sized.
The Massachusetts Institute of Technology (M.I.T.) invented turtle graphics as a method to teach mathematical thought and computer programming to children.
Turtle graphics remains valid as a quick and easy method to see how a computer responds to a series of instructions one step at a time.
Introduction tour: Learn how to use turtle graphics.
Click on the button labelled start. This stops the opening animation and places an old-school turtle in the center of the graphics area.
If you are feeling adventurous, you can try clicking on the buttons in the TurtleGrafX area and see what happens. Or you can follow the step by step instructions explaining what each button does.
Click once on the button labelled forward. You will see the turtle move forward and leave behind a short red line.
Click once on the button labelled right. You will see the turtle swing to the right (without drawing any new lines).
Click once on the button labelled forward. You will see the turtle move forward and leave behind a short red line.
Repeat the above two steps (click right then click forward) and you will end up with a small red square.
Click once on the button labelled left. The turtle will now swing to the left.
Click on the button labelled color chart. This will cause a large color chart to appear (you can click again on the color chart button to make it disappear and reappear). Click on the second color in the second row (yellow). If yo0u are feeling adventurous, you may pick any color you like. Dark colors and bright colors will work better. You may be very disappointed if you choose a white or very light color.
[OPTIONAL] If you want to type your commands, click on the button labelled drawing and look at the section labelled drawing inputs and find the box labelled stroke color (top left). You will see a strange looking value of #ff0000. Type in yellow.
Now click on the forward button and you will see that the turtle leaves behind a yellow line. If you picked a different color, the line will match the color you picked.
Change the stroke color to green (the third color in second row) and back button and the turtle leaves behind a green line. But you cant see the line because the turtle is covering it up. You may pick any color you want.
Click on the hideturtle button and the turtle will disappear, revealing the green line (or whatever color you picked).
Click on the back button again and the green line will get longer, even though you cant see the turtle.
Click on the showturtle button to bring the turtle back to the screen.
It is completely up to you whether you want to draw with the turtle visible or invisible. DIfferent people prefer different methods. If you draw with the turtle invisible and lose track of where you are drawing, you can briefly make the turtle visible again.
Click on the clearscreen button and the previous drawing will be erased and the turtle will be centered in the drawing area. If the turtle was visible, it will remain visible. If the turtle was invisible, it will remain invisible.
Now you are going to make a dotted line. Feel free to pick any new color you like.
Click on the right button so that you have plenty of room for your line.
Next click on the penup button and then click on the forward button twice. The turtle (whether visible or not) will move forward two steps.
Now click on the pendown button and then click twice on the forward button. The turtle (visble or not) will start drawing again.
Next click on the penup button and then click on the forward button twice. Then click on the pendown button and then click on the forward button twice. Repeat. You should end up with a dotted line.
If you experiment a little, you will find that repeating penup over and over again just makes sure that the pen is up. The penup, pendown, hideturtle, showturtle buttons dont change anything if you keep pressing the same button over and over again. So, it is always safe to press those buttons again if you forgot how you have them set.
You can click on the home button to make your turtle (visible or not) jump back to the center of the drawing area. No line will drawn from the old location to the center. You can use this method to quickly get back to the center without erasing your picture.
Lets return briefly to the stroke color. You can change the color you are drawing at any time. Just click on the color you want from the color chart near the Turtle GrafX buttons. If you are color blind, use the top row (black, grays, and white) and whatever you draw will look the same to you and your classmates.
There are 140 officially recognized color names. You can type in any of the following color names (it does not matter if you use upper or lower case letters).
color name | color | hex |
---|---|---|
AliceBlue | #F0F8FF | |
AntiqueWhite | #FAEBD7 | |
Aqua | #00FFFF | |
AquaMarine | #7FFFD4 | |
Azure | #F0FFFF | |
Beige | #F5F5DC | |
Bisque | #FFE4C4 | |
Black | #000000 | |
BlanchedAlmond | #FFEBCD | |
Blue | #0000FF | |
BlueViolet | #8A2BE2 | |
Brown | #A52A2A | |
BurlyWood | #DEB887 | |
CadetBlue | #5F9EA0 | |
Chartreuse | #7FFF00 | |
Chocolate | #D2691E | |
Coral | #FF7F50 | |
CornflowerBlue | #6495ED | |
Cornsilk | #FFF8DC | |
Crimson | #DC143C | |
Cyan | #00FFFF | |
DarkBlue | #00008B | |
DarkCyan | #008B8B | |
DarkGoldenRod | #B8860B | |
DarkGray | #A9A9A9 | |
DarkGreen | #006400 | |
DarkKhaki | #BDB76B | |
DarkMagenta | #8B008B | |
DarkOliveGreen | #556B2F | |
DarkOrange | #FF8C00 | |
DarkOrchid | #9932CC | |
DarkRed | #8B0000 | |
DarkSalmon | #E9967A | |
DarkSeaGreen | #8FBC8F | |
DarkSlateBlue | #483D8B | |
DarkSlateGray | #2F4F4F | |
DarkTurquoise | #00CED1 | |
DarkViolet | #9400D3 | |
DeepPink | #FF1493 | |
DeepSkyBlue | #00BFFF | |
DimGray | #696969 | |
DodgerBlue | #1E90FF | |
FireBrick | #B22222 | |
FloralWhite | #FFFAF0 | |
ForestGreen | #228B22 | |
Fuchsia | #FF00FF | |
Gainsboro | #DCDCDC | |
GhostWhite | #F8F8FF | |
Gold | #FFD700 | |
GoldenRod | #DAA520 | |
Gray | #808080 | |
Green | #008000 | |
GreenYellow | #ADFF2F | |
HoneyDew | #F0FFF0 | |
HotPink | #FF69B4 | |
IndianRed | #CD5C5C | |
Indigo | #4B0082 | |
Ivory | #FFFFF0 | |
Khaki | #F0E68C | |
Lavender | #E6E6FA | |
LavenderBlush | #FFF0F5 | |
LawnGreen | #7CFC00 | |
LemonChiffon | #FFFACD | |
LightBlue | #ADD8E6 | |
LightCoral | #F08080 | |
LightCyan | #E0FFFF | |
LightGoldenRodYellow | #FAFAD2 | |
LightGray | #D3D3D3 | |
LightGreen | #90EE90 | |
LightPink | #FFB6C1 | |
LightSalmon | #FFA07A | |
LightSeaGreen | #20B2AA | |
LightSkyBlue | #87CEFA | |
LightSlateGray | #778899 | |
LightSteelBlue | #B0C4DE | |
LightYellow | #FFFFE0 | |
Lime | #00FF00 | |
LimeGreen | #32CD32 | |
Linen | #FAF0E6 | |
Magenta | #FF00FF | |
Maroon | #800000 | |
MediumAquaMarine | #66CDAA | |
MediumBlue | #0000CD | |
MediumOrchid | #BA55D3 | |
MediumPurple | #9370DB | |
MediumSeaGreen | #3CB371 | |
MediumSlateBlue | #7B68EE | |
MediumSpringGreen | #00FA9A | |
MediumTurquoise | #48D1CC | |
MediumVioletRed | #C71585 | |
MidnightBlue | #191970 | |
MintCream | #F5FFFA | |
MistyRose | #FFE4E1 | |
Moccasin | #FFE4B5 | |
NavajoWhite | #FFDEAD | |
Navy | #000080 | |
OldLace | #FDF5E6 | |
Olive | #808000 | |
OliveDrab | #6B8E23 | |
Orange | #FFA500 | |
OrangeRed | #FF4500 | |
Orchid | #DA70D6 | |
PaleGoldenRod | #EEE8AA | |
PaleGreen | #98FB98 | |
PaleTurquoise | #AFEEEE | |
PaleVioletRed | #DB7093 | |
PapayaWhip | #FFEFD5 | |
PeachPuff | #FFDAB9 | |
Peru | #CD853F | |
Pink | #FFC0CB | |
Plum | #DDA0DD | |
PowderBlue | #B0E0E6 | |
Purple | #800080 | |
Red | #FF0000 | |
RosyBrown | #BC8F8F | |
RoyalBlue | #4169E1 | |
SaddleBrown | #8B4513 | |
Salmon | #FA8072 | |
SandyBrown | #F4A460 | |
SeaGreen | #2E8B57 | |
SeaShell | #FFF5EE | |
Sienna | #A0522D | |
Silver | #C0C0C0 | |
SkyBlue | #87CEEB | |
SlateBlue | #6A5ACD | |
SlateGray | #708090 | |
Snow | #FFFAFA | |
SpringGreen | #00FF7F | |
SteelBlue | #4682B4 | |
Tan | #D2B48C | |
Teal | #008080 | |
Thistle | #D8BFD8 | |
Tomato | #FF6347 | |
Turquoise | #40E0D0 | |
Violet | #EE82EE | |
Wheat | #F5DEB3 | |
White | #FFFFFF | |
WhiteSmoke | #F5F5F5 | |
Yellow | #FFFF00 | |
YellowGreen | #9ACD32 |
If you try using white to erase previous lines, you may (depending on the browser you use) find that faint edges of the old color are left behind. Try to get your drawing right without having to erase.
If you want to record your drawing as you create it, press the record button. Every step you use for making your picture will be recorded. When you are done, press the stop button (the same button, renamed). You can copy and paste the resulting text to replay your drawing, turn in assignments, and share with friends.
End of introduction tour.
Assignment: Now that you have a feel for how turtle graphics works, try to create your own picture.
This assignment will require planning, because you will need to figure out the right steps to maneuver the turtle for you artistic vision. This is the exact kind of thinking that you will need to program computers and make your own game.
Once you have planned out how to draw your picture, you can share your list of steps with your classmates and they can exactly copy your artwork.
You will make mistakes as you learn how to tell the computer how to draw. Be patient. Relax. Accept the mistakes and you will be able to draw a great picture.
Optional advanced techniques: You may want to try out some additional optional techniques. These are not required and may be beyond the ability of younger children, but if you want to use any of these to improve your drawing, feel free to experiment.
You may have noticed that there are several buttons above the color chart and that Stroke is currently selected. Stroke is the name for the line the turtle draws. It is also the name for the outline on more advanced shapes.
One of the other choices is Background. Try clicking on Background and then select any color of your choice (other than white). You will see the entire background change to match the color you just clicked on. The Background always starts as white, but you can set it to any color you want.
Coming up: You may have noticed that turtle graphics is somewhat slow and clumsy. Next you will learn how to use the drawing inputs and the drawing buttons to create pictures using some basic shapes.
This is the reference guide to this software. Use this section to look up information. Use the instructions area for to learn how to program computers.
The initial version of this software combines Turtle Graphics, Forth, and PostScript. While there is nice overlap between these technologies, there are also some incompatibilities.
A control for language parsing mode is planned, allowing a programmer to specify that coding is occuring in a particular programming language. Otherwise, a generic general combined language (documented below) is in use.
Stack The stack uses a PostScript approach of storing objects rather than low level characters and fixed-width binary numbers. A mode control is planned to allow a F Forth-style stack. Most Forth words should work fine without any knowledge of the stack storing objects. Some Forth words (such as byte or double integer words) may work as expected, with automatic translation between stack styles.
Input The input area is initially labelled Type commands here. There is a separate enter button to allow multi-line input (JavaScript does not distinguish between the return key and the enter key, so all uses of either key are to add a CR/LF to the input text. Further testing is needed, but the input area seems to accept input of any printable characters in the UTF-16 character set [unconfirmed]. Further testing is needed to filter out all of the extra garbage each web browser automatically adds to the users input text.
Output The output area is immediately above the input area. This is where output text is normally directed. There will be text drawing commands for the canvas area.
Canvas The canvas area is near the top of the web page. This is the area for visual output. There is currently a problem interpretting mouse location if the web page is scrolled any amount from the top of the page. This is on the to-do list.
Words The interpreter parses in a manner very similar to both Forth and PostScript, dividing input into tokens, looking up those tokens in a dictionary, with a fallback of number processing (placing found numbers on the stack).
The first goal is to accept every valid program in the supported programming languages and correctly implement the code specified by the valid program.
The second goal is to try to be very forgiving of errors. Although most compilers try to reject all invalid programs, this is not an important goal for this project. This project will attempt to take the approach commonly used in web browsers of trying to be very forgiving of errors.
There are direct graphic-user interface access to some drawing capabilities. Some of these capabilities are not yet implemented as words.
The GrafX button reveals buttons for controlling the turtle. All of the turtle buttons are available as words. Beneath the turtle buttons are radio buttons for grafx, rectangle, and circle.
If the user clicks the mouse anywhere in the canvas, one of the three drawing operations will occur.
In grafx mode, the mouse click moves the turtle position, without drawing.
In rectangle mode, the mouse click chooses one corner of the rectangle and further motion of the mouse with the button held down will choose the far diagonal corner of the rectangle.
In circle mode, the mouse click chooses the center of the circle and further motion of the mouse with the button held down will choose the radius of the circle.
After drawing each rectangle or circle, two additional buttons will appear.
The move radio button will cause mouse clicks (and moves with the button down) to move the most recently drawn circle or rectangle. Clicking on the rectangle or circle radio buttons will return to drawing mode.
The delete button will remove the last item drawn (circle, rectangle, or turtle line). Each subsequent use of the delete button will remove one more item drawn in reverse order that they were drawn.
The drawing button will reveal a number of controls for the turtle, rectangles, circles, and lines. Not all of these capabilities have been implemented as word yet.
The line, arc, and cloud buttons are not fully functional yet.
Words are arranged in alphabetical order based on the UTF-16 collating sequence. Tables for logical grouping of words will be added.
Character case does not matter (except in character strings). All tokens are converted into capital letters upon input.
word | name | language category |
---|---|---|
stack start --- stack end | ||
description |
white space | Forth CORE/PostScript separator | |
The following white space characters are used as separators between tokens (unless part of a string): HT (horizontal tab), LF (line feed), VT (vertical tab), FF (form feed), CR (carriage return), and space. Implementation note: not all of these are currently surviving to the interpreter. The space is recommended as the primary white space character. |
! | store (exclamation point) | Forth CORE memory reference |
---|---|---|
x a-addr --- | ||
Pops the top two items from the stack and stores the second object down from the stack (x) into the memory cell designated by the number that was on top of the stack (a-addr). All cells are numbered consecutively, starting at zero. Each cell holds an object. The word here gives the expected next free memory cell. Current implementation allows ignoring here and storing at any arbitrary random-access memory cell, although this use might lead to serious conflicts with the use of the here word. The maximum number of memory cells is implementation-defined (limited by the actual web browser used). Checks to confirm that there are at least two objects on the stack and that the object on the top of the stack is numeric (either a binary number or a string that can be converted to a number). Stops and reports any error. |
% | percent | generic stack language mathematics |
---|---|---|
n1 n2 --- n3 | ||
Pops the top two items on the stack, determines percentage, then pushes the answer (n3) to the top of the stack. The number on the top of the stack (n2) is the percentage of the number second on the stack (n1). Example: 300 14 % will give the answer 42, which is 14% of 300. |
%T | percent of total | generic stack language mathematics |
---|---|---|
n1 n2 --- n3 | ||
Pops the top two items on the stack, determines percentage, then pushes the answer (n3) to the top of the stack. The number on the top of the stack (n2) is the partial number and the number second on the stack (n1) is the total and the answer (n3) is the percentage that the n1 is of n2. Example: 5 4 %T will give the answer 80, because 4 is 80% of 5. |
' | tick (single quote) | Forth CORE system |
---|---|---|
<spaces>name --- xt | ||
This word is not in its final form -- this is a temporary transition word until several other related words are implemented. The object on the top of the stack is (case-insensitive) match checked against the dictionary. If a matching character string (name) is found in the dictionary, the compliation address (xt) is pushed to the top of the stack. |
* | multiply (asterisk) | Forth CORE mathematics |
---|---|---|
n1|u1 n2|u2 --- n3|u3 | ||
Pops the top two items on the stack and multiplies the top number (n2 or u2) by the second to top number (n1 or u1), then pushes the total (n3 or u3) to the top of the stack. Implementation note: This word will accept both integer and floating point input and will produce floating point output whenever there is a non-integer result. Checks to confirm that both of the top two objects on the stack are numbers (either as binary numbers or as character strings that convert to numbers). Stops without action (other than error report) if either test fails or if there are less than two objects on the stack. |
+ | add (plus) | Forth CORE mathematics |
---|---|---|
n1|u1 n2|u2 --- n3|u3 | ||
Pops the top two items on the stack and adds the top number (n2 or u2) to the second to top number (n1 or u1), then pushes the total (n3 or u3) to the top of the stack. Checks to confirm that both of the top two objects on the stack are numbers (either as binary numbers or as character strings that convert to numbers) or if there are less than two objects on the stack. Stops without action (other than error report) if either test fails. Implementation note: This word will accept both integer and floating point input and will produce floating point output whenever there is a non-integer result. |
+! | plus store (plus-store) | Forth CORE memory reference |
---|---|---|
n1|u1 a-addr --- | ||
Pops the top two items on the stack. The item on the top of the stack (a-addr) is a numeric address into random-access memory. The item that is second on the stack (n1 or u1) is a number to be added to the object stored in the designated memory cell. A check is made to guarantee that the object in memory is a number (either as a binary number or a character string that can be converted into a valid number). If this check fails, the word stops with an error report, but does not restore the previous state of the stack, although the object in memory is unchanged. Checks to confirm that both of the top two objects on the stack are numbers (either as binary numbers or as character strings that convert to numbers) or if there are less than two objects on the stack. Stops without action (other than error report) if either test fails. |
- | subtract or minus (hyphen) | Forth CORE mathematics |
---|---|---|
n1|u1 n2|u2 --- n3|u3 | ||
Pops the top two items on the stack and subtracts them, then pushes the total (n3 or u3) to the top of the stack. The number on the top of the stack (n2 or u2) is subtracted from the number second on the stack (n1 or u1). Example: algebriac notation 3 - 2 = would be converted into RPN (stack) notation 3 2 - . (answer is 1). Checks to confirm that both of the top two objects on the stack are numbers (either as binary numbers or as character strings that convert to numbers). Stops without action (other than error report) if either test fails or if there are less than two objects on the stack. Implementation note: This word will accept both integer and floating point input and will produce floating point output whenever there is a non-integer result. |
. | dot (period, dot) | Forth CORE I/O |
---|---|---|
n --- | ||
Pops the top object from the stack (n) and places it into the output text area. If the stack is empty, this word instead generates a stack empty error report. |
.S | dot-s | Forth non-standard I/O |
---|---|---|
Shows all of the objects on the stack (in order from bottom to top) without disturbing the stack. |
/ | divide (slash) | Forth CORE mathematics |
---|---|---|
n1 n2 --- n3 | ||
Pops the top two items on the stack and divides them, then pushes the total (n3) to the top of the stack. The number on the top of the stack (n2) is divided from the number second on the stack (n1). Example: algebriac notation 4/2 = would be converted into RPN (stack) notation 4 2 / . (answer is 2). Checks to confirm that both of the top two objects on the stack are numbers (either as binary numbers or as character strings that convert to numbers). Stops without action (other than error report) if either test fails or if there are less than two objects on the stack. Implementation note: This word will accept both integer and floating point input and will produce floating point output whenever there is a non-integer result. Use the special word idiv to obtain a Forth-style integer-only result. |
1+ | one plus (increment) | Forth CORE mathematics |
---|---|---|
n1 --- n2 | ||
Pops the number from the top of the stack (n1), adds one (1), and places the sum (n2) on the top of the stack. Checks to confirm that there is at least one item on the stack and the top object on the stack is a number (either a binary number or a character string that convert to numbers). Stops without action (other than error report) if either test fails. |
1- | one minus (decrement) | Forth CORE mathematics |
---|---|---|
n1 --- n2 | ||
Pops the number from the top of the stack (n1), subtracts one (1), and places the sum (n2) on the top of the stack. Checks to confirm that there is at least one item on the stack and the top object on the stack is a number (either a binary number or a character string that convert to numbers). Stops without action (other than error report) if either test fails. |
10* | ten times (ten star, ten asterisk) | Forth uncontrolled mathematics |
---|---|---|
n1|u1 --- n2 | ||
Pops the top item from the stack (n1 or u1), multiplies by ten (10), then pushes the product (n2) to the top of the stack. Checks to confirm that there is at least one item on the stack and the top object on the stack is a number (either a binary number or a character string that convert to numbers). Stops without action (other than error report) if either test fails. |
10+ | ten plus | Forth nonstandard mathematics |
---|---|---|
n1 --- n2 | ||
Pops the number from the top of the stack (n1), adds ten (10), and places the sum (n2) on the top of the stack. Checks to confirm that there is at least one item on the stack and the top object on the stack is a number (either a binary number or a character string that convert to numbers). Stops without action (other than error report) if either test fails. |
10- | ten minus | Forth nonstandard mathematics |
---|---|---|
n1|u1 --- n2 | ||
Pops the top item from the stack (n1 or u1), subtracts ten (10), then pushes the difference (n2) to the top of the stack. Checks to confirm that there is at least one item on the stack and the top object on the stack is a number (either a binary number or a character string that convert to numbers). Stops without action (other than error report) if either test fails. |
10/ | ten divide (ten slash) | Forth nonstandard mathematics |
---|---|---|
n1|u1 --- n2 | ||
Pops the top item from the stack (n1 or u1), divides by ten (10), then pushes the quotient (n2) to the top of the stack. Checks to confirm that there is at least one item on the stack and the top object on the stack is a number (either a binary number or a character string that convert to numbers). Stops without action (other than error report) if either test fails. |
16* | 16 times (16 star, 16 asterisk) | Forth uncontrolled mathematics |
---|---|---|
n1|u1 --- n2 | ||
Pops the top item from the stack (n1 or u1), multiplies by 16, then pushes the product (n2) to the top of the stack. Checks to confirm that there is at least one item on the stack and the top object on the stack is a number (either a binary number or a character string that convert to numbers). Stops without action (other than error report) if either test fails. |
16+ | 16 plus | Forth nonstandard mathematics |
---|---|---|
n1 --- n2 | ||
Pops the number from the top of the stack (n1), adds 16, and places the sum (n2) on the top of the stack. Checks to confirm that there is at least one item on the stack and the top object on the stack is a number (either a binary number or a character string that convert to numbers). Stops without action (other than error report) if either test fails. |
16- | 16 minus | Forth nonstandard mathematics |
---|---|---|
n1|u1 --- n2 | ||
Pops the top item from the stack (n1 or u1), subtracts 16, then pushes the difference (n2) to the top of the stack. Checks to confirm that there is at least one item on the stack and the top object on the stack is a number (either a binary number or a character string that convert to numbers). Stops without action (other than error report) if either test fails. |
16/ | 16 divide (16 slash) | Forth nonstandard mathematics |
---|---|---|
n1|u1 --- n2 | ||
Pops the top item from the stack (n1 or u1), divides by 16, then pushes the quotient (n2) to the top of the stack. Checks to confirm that there is at least one item on the stack and the top object on the stack is a number (either a binary number or a character string that convert to numbers). Stops without action (other than error report) if either test fails. |
2* | two times (two star, two asterisk) | Forth CORE mathematics |
---|---|---|
n1|u1 --- n2 | ||
Pops the number from the top of the stack (n1), multiplies by two (2), and places the product (n2) on the top of the stack. Checks to confirm that there is at least one item on the stack and the top object on the stack is a number (either a binary number or a character string that convert to numbers). Stops without action (other than error report) if either test fails. |
2+ | two plus | Forth nonstandard mathematics |
---|---|---|
n1 --- n2 | ||
Pops the number from the top of the stack (n1), adds two (2), and places the sum (n2) on the top of the stack. Checks to confirm that there is at least one item on the stack and the top object on the stack is a number (either a binary number or a character string that convert to numbers). Stops without action (other than error report) if either test fails. |
2- | two minus | Forth nonstandard mathematics |
---|---|---|
n1|u1 --- n2 | ||
Pops the top item from the stack (n1 or u1), subtracts two (2), then pushes the difference (n2) to the top of the stack. Checks to confirm that there is at least one item on the stack and the top object on the stack is a number (either a binary number or a character string that convert to numbers). Stops without action (other than error report) if either test fails. |
2/ | two slash | Forth CORE mathematics |
---|---|---|
n1 --- n2 | ||
Pops the number from the top of the stack (n1), divides by two (2), and places the quotient (n2) on the top of the stack. Checks to confirm that there is at least one item on the stack and the top object on the stack is a number (either a binary number or a character string that convert to numbers). Stops without action (other than error report) if either test fails. |
3+ | three plus | Forth nonstandard mathematics |
---|---|---|
n1 --- n2 | ||
Pops the number from the top of the stack (n1), adds three (3), and places the sum (n2) on the top of the stack. Checks to confirm that there is at least one item on the stack and the top object on the stack is a number (either a binary number or a character string that convert to numbers). Stops without action (other than error report) if either test fails. |
3- | three minus | Forth nonstandard mathematics |
---|---|---|
n1|u1 --- n2 | ||
Pops the top item from the stack (n1 or u1), subtracts three (3), then pushes the difference (n2) to the top of the stack. Checks to confirm that there is at least one item on the stack and the top object on the stack is a number (either a binary number or a character string that convert to numbers). Stops without action (other than error report) if either test fails. |
4* | four times (four star, four asterisk) | Forth uncontrolled mathematics |
---|---|---|
n1|u1 --- n2 | ||
Pops the top item on the stack(n1 or u1), multiplies by four (4), then pushes the product (n2) to the top of the stack. Checks to confirm that there is at least one item on the stack and the top object on the stack is a number (either a binary number or a character string that convert to numbers). Stops without action (other than error report) if either test fails. |
4+ | four plus | Forth nonstandard mathematics |
---|---|---|
n1 --- n2 | ||
Pops the number from the top of the stack (n1), adds four (4), and places the sum (n2) on the top of the stack. Checks to confirm that there is at least one item on the stack and the top object on the stack is a number (either a binary number or a character string that convert to numbers). Stops without action (other than error report) if either test fails. |
4- | four minus) | Forth nonstandard mathematics |
---|---|---|
n1|u1 --- n2 | ||
Pops the top item from the stack (n1 or u1), subtracts four (4), then pushes the difference (n2) to the top of the stack. Checks to confirm that there is at least one item on the stack and the top object on the stack is a number (either a binary number or a character string that convert to numbers). Stops without action (other than error report) if either test fails. |
4/ | four divide (four slash) | Forth nonstandard mathematics |
---|---|---|
n1|u1 --- n2 | ||
Pops the top item from the stack (n1 or u1), divides by four (4), then pushes the quotient (n2) to the top of the stack. Checks to confirm that there is at least one item on the stack and the top object on the stack is a number (either a binary number or a character string that convert to numbers). Stops without action (other than error report) if either test fails. |
5+ | five plus | Forth nonstandard mathematics |
---|---|---|
n1 --- n2 | ||
Pops the number from the top of the stack (n1), adds five (5), and places the sum (n2) on the top of the stack. Checks to confirm that there is at least one item on the stack and the top object on the stack is a number (either a binary number or a character string that convert to numbers). Stops without action (other than error report) if either test fails. |
5- | five minus | Forth nonstandard mathematics |
---|---|---|
n1|u1 --- n2 | ||
Pops the top item from the stack (n1 or u1), subtracts five (5), then pushes the difference (n2) to the top of the stack. Checks to confirm that there is at least one item on the stack and the top object on the stack is a number (either a binary number or a character string that convert to numbers). Stops without action (other than error report) if either test fails. |
6+ | six plus | Forth nonstandard mathematics |
---|---|---|
n1 --- n2 | ||
Pops the number from the top of the stack (n1), adds six (6), and places the sum (n2) on the top of the stack. Checks to confirm that there is at least one item on the stack and the top object on the stack is a number (either a binary number or a character string that convert to numbers). Stops without action (other than error report) if either test fails. |
6- | six minus | Forth nonstandard mathematics |
---|---|---|
n1|u1 --- n2 | ||
Pops the top item from the stack (n1 or u1), subtracts six (6), then pushes the difference (n2) to the top of the stack. Checks to confirm that there is at least one item on the stack and the top object on the stack is a number (either a binary number or a character string that convert to numbers). Stops without action (other than error report) if either test fails. |
7+ | seven plus | Forth nonstandard mathematics |
---|---|---|
n1 --- n2 | ||
Pops the number from the top of the stack (n1), adds seven (7), and places the sum (n2) on the top of the stack. Checks to confirm that there is at least one item on the stack and the top object on the stack is a number (either a binary number or a character string that convert to numbers). Stops without action (other than error report) if either test fails. |
7- | seven minus | Forth nonstandard mathematics |
---|---|---|
n1|u1 --- n2 | ||
Pops the top item from the stack (n1 or u1), subtracts seven (7), then pushes the difference (n2) to the top of the stack. Checks to confirm that there is at least one item on the stack and the top object on the stack is a number (either a binary number or a character string that convert to numbers). Stops without action (other than error report) if either test fails. |
8* | eight times (eight star, eight asterisk) | Forth uncontrolled mathematics |
---|---|---|
n1|u1 --- n2 | ||
Pops the top item from the stack (n1 or u1), multiplies by eight (8), then pushes the product (n2) to the top of the stack. Checks to confirm that there is at least one item on the stack and the top object on the stack is a number (either a binary number or a character string that convert to numbers). Stops without action (other than error report) if either test fails. |
8+ | eight plus | Forth nonstandard mathematics |
---|---|---|
n1 --- n2 | ||
Pops the number from the top of the stack (n1), adds eight (8), and places the sum (n2) on the top of the stack. Checks to confirm that there is at least one item on the stack and the top object on the stack is a number (either a binary number or a character string that convert to numbers). Stops without action (other than error report) if either test fails. |
8- | eight minus | Forth nonstandard mathematics |
---|---|---|
n1|u1 --- n2 | ||
Pops the top item from the stack (n1 or u1), subtracts eight (8), then pushes the difference (n2) to the top of the stack. Checks to confirm that there is at least one item on the stack and the top object on the stack is a number (either a binary number or a character string that convert to numbers). Stops without action (other than error report) if either test fails. |
8/ | eight divide (eight slash) | Forth nonstandard mathematics |
---|---|---|
n1|u1 --- n2 | ||
Pops the top item from the stack (n1 or u1), divides by eight (8), then pushes the quotient (n2) to the top of the stack. Checks to confirm that there is at least one item on the stack and the top object on the stack is a number (either a binary number or a character string that convert to numbers). Stops without action (other than error report) if either test fails. |
9+ | nine plus | Forth nonstandard mathematics |
---|---|---|
n1 --- n2 | ||
Pops the number from the top of the stack (n1), adds nine (9), and places the sum (n2) on the top of the stack. Checks to confirm that there is at least one item on the stack and the top object on the stack is a number (either a binary number or a character string that convert to numbers). Stops without action (other than error report) if either test fails. |
9- | nine minus | Forth nonstandard mathematics |
---|---|---|
n1|u1 --- n2 | ||
Pops the top item from the stack (n1 or u1), subtracts nine (9), then pushes the difference (n2) to the top of the stack. Checks to confirm that there is at least one item on the stack and the top object on the stack is a number (either a binary number or a character string that convert to numbers). Stops without action (other than error report) if either test fails. |
: | colon | Forth CORE system |
---|---|---|
<spaces>name --- colon-sys | ||
Skip leading space delimiters. Parse name delimited by space. Create a definition for the name, called a colon definition. Enter compilation state and start the current definition, producing colon-sys. Append the initiation semantics to the current definition. The execution semantics of name will be determined by the words compiled into the body of the defintiion. The current defintion shall not be findable in the dictionary until it is ended (or the execution of DOES>. |
; | semicolon | Forth CORE system |
---|---|---|
colon-sys --- | ||
Append the run-time semantics below to the current definition. End the current definition, allow it to be found in the dictionary, and enter the interpretation state, consuming colon-sys. If the data-space pointer is not aligned, reserve enough data space to align it. At run-time return to the calling definition specified by next-sys. |
? | fetch and display (question mark) | Forth nonstandard I/O |
---|---|---|
a-addr --- | ||
Checks to make sure that there is at least one object on the stack and that the object on the top of the stack is numeric (either as a binary number or as a character string that can be converted into a valid number). Stops and reports on error. Pops the object from the top of the stack (a-addr) and finds the object in the memory cell with that number. Outputs the object found in that memory cell to the output text area. This is equivalent to using the two words @ . |
@ | fetch (at sign) | Forth CORE I/O |
---|---|---|
a-addr --- x | ||
Checks to make sure that there is at least one object on the stack and that the object on the top of the stack is numeric (either as a binary number or as a character string that can be converted into a valid number). Stops and reports on error. Pops the object from the top of the stack (a-addr) and finds the object (x) in the memory cell with that number. Pushes the object found in memory (x) on to the top of the stack. |
abs | abs or absolute value | Forth CORE/PostScript mathematics |
---|---|---|
n --- u | ||
Pops the top object from the stack (n), then pushes the absolute value (u) to the top of the stack. Checks to confirm that there is at least one item on the stack and the top object on the stack is a number (either a binary number or a character string that convert to numbers). Stops without action (other than error report) if either test fails. |
add | addition | PostScript mathematics |
---|---|---|
num1 num2 --- sum | ||
Pops the top two items on the stack and adds the top number (num2) to the second to top number (num1), then pushes the total (sum) to the top of the stack. Checks to confirm that both of the top two objects on the stack are numbers (either as binary numbers or as character strings that convert to numbers) or if there are less than two objects on the stack. Stops without action (other than error report) if either test fails. |
back | back or backwards | Turtle Graphics graphics |
---|---|---|
color steplength strokewidth --- | ||
Moves the turtle backwards one step. If the pen is down, a line is drawn. If the turtle is in show mode, then the turtle is shown. The order of objects expected on the top of the stack are: color, steplength, and strokewidth. |
clear | clear stack | PostScript stack |
---|---|---|
<any> --- <empty> | ||
Removes everything from the stack. |
clearcanvas | clear canvas | Turtle Graphics graphics |
---|---|---|
--- | ||
Clears the canvas to the current background color. |
clearstack | clear stack | Forth nonstandard stack |
---|---|---|
<any> --- <empty> | ||
Removes everything from the stack. |
cos | cosine | generic stack language mathematics |
---|---|---|
n1|u1 --- n2 | ||
Checks to make sure there is at least one object on the stack and that the object on the top of the stack is numeric (either binary number or a character string that can be converted into a number). Stops without action (other than error report) if either test fails. If the object on the top of the stack is a valid number (n1 or u1), computes the trigonometric cosine function of cos(n1), n1 being in radians and pushes this answer (n2) to the top of the stack. |
cot | cotangent | generic stack language mathematics |
---|---|---|
n1|u1 --- n2 | ||
Checks to make sure there is at least one object on the stack and that the object on the top of the stack is numeric (either binary number or a character string that can be converted into a number). Stops without action (other than error report) if either test fails. If the object on the top of the stack is a valid number (n1 or u1), computes the trigonometric cotangent function of cot(n1), n1 being in radians and pushes this answer (n2) to the top of the stack. |
csc | cosecant | generic stack language mathematics |
---|---|---|
n1|u1 --- n2 | ||
Checks to make sure there is at least one object on the stack and that the object on the top of the stack is numeric (either binary number or a character string that can be converted into a number). Stops without action (other than error report) if either test fails. If the object on the top of the stack is a valid number (n1 or u1), computes the trigonometric cosecant function of csc(n1), n1 being in radians and pushes this answer (n2) to the top of the stack. |
decimalantilograithm | decimal antilogarithm ex | generic stack language mathematics |
---|---|---|
n1|u1 --- n2 | ||
Checks to make sure there is at least one object on the stack and that the object on the top of the stack is numeric (either binary number or a character string that can be converted into a number). Stops without action (other than error report) if either test fails. If the object on the top of the stack is a valid number (n1 or u1), computes the decimal antilogarithm of 10n1 (n1) and pushes this answer (n2) to the top of the stack. |
degreestoradians | degrees to radians conversion | generic stack language mathematics |
---|---|---|
n1|u1 --- n2 | ||
Checks to make sure there is at least one object on the stack and that the object on the top of the stack is numeric (either binary number or a character string that can be converted into a number). Stops without action (other than error report) if either test fails. If the object on the top of the stack is a valid number (n1 or u1), converts the number (n1 or u1) from degrees to radians and pushes this answer (n2) to the top of the stack. |
delta% | percent difference | generic stack language mathematics |
---|---|---|
n1 n2 --- n3 | ||
Pops the top two items on the stack, determines percentage, then pushes the answer (n3) to the top of the stack. The number on the top of the stack (n2) is the base number and the number second on the stack (n1) is the new number and the answer (n3) is the percentage difference (change) between n1 and n2. Example: 5 4 deltaT will give the answer -20, because 4 is a -20% decrease from 5. |
depth | depth | Forth CORE stack |
---|---|---|
--- +n | ||
Counts the number of objects on the stack and pushes that number (+n) onto the top of the stack. If there were no objects on the stack, this word pushes 0 (zero) to the top of the stack. |
div | divide or division | PostScript mathematics |
---|---|---|
num1 num2 --- quotient | ||
Pops the top two items on the stack and divides them, then pushes the total (quotient) to the top of the stack. The number on the top of the stack (num2) is divided from the number second on the stack (num1). Example: algebriac notation 4/2 = would be converted into RPN (stack) notation 4 2 div . (answer is 2). Checks to confirm that both of the top two objects on the stack are numbers (either as binary numbers or as character strings that convert to numbers). Stops without action (other than error report) if either test fails or if there are less than two objects on the stack. Use the word idiv to obtain an integer-only result. |
drawcircle | draw circle | generic stack language graphics |
---|---|---|
fillcolor xcenter ycenter radius gradientstartcolor gradientendcolor linecolor strokewidth filltype --- | ||
Draws a circle in the canvas. The order of items on the stack are: fillcolor, xcenter, ycenter, radius, gradientstartcolor, gradientendcolor, linecolor, strokewidth, filltype. |
drawrectangle | draw rectangle | generic stack language graphics |
---|---|---|
linecolor fillcolor itemleft itemtop itemwidth itemheight strokewidth --- | ||
Draws a rectangle in the canvas. The order of items on the stack are: linecolor, fillcolor, itemleft, itemtop, itemwidth, itemheight, strokewidth. |
drop | drop | Forth CORE stack |
---|---|---|
x --- | ||
Removes the top object (x) on the stack from the stack, leaving the rest of the stack undisturbed. Reports an error if there are no objects on the stack. |
dup | duplicate | Forth CORE/PostScript stack |
---|---|---|
x --- x x | ||
Duplicates the oject on the top of the stack (x). That is, makes a copy of the object on the top of the stack (not a deep copy for composite objects) and pushes the new copy on to the top of the stack without disturbing the previous object. Reports an error if there are no objects on the stack. |
e | Eulers number | generic stack language mathematics |
---|---|---|
--- n | ||
Places Eulers number (n) on the top of the stack (approximately 2.718). |
eq | equal (equality test) | PostScript boolean, relational |
---|---|---|
any1 any2 --- bool | ||
Pops and compares the two top objects on the stack. If the second object on the stack (any1) is equal to the object on top of the stack (any2), pushes Boolean true (bool) to the stack. Otherwise pushes Boolean false (bool) to the stack. Checks to guarantee there are at least two objects on the stack and stops if the test fails. Implementation note: Currently only works for binary numbers (integer and floating point numbers of same value are considered equal). |
exch | exchange | PostScript stack |
---|---|---|
any1 any2 --- any2 any1 | ||
Exchanges the top two objects (any1 and any2) on the stack. Checks to guaranatee that there at least two objects on the stack and stops with error if there are only one or zero items on the stack. Same functionality as Forths swap. |
execute | execute | Forth CORE system |
---|---|---|
xt --- | ||
Pops the object from the top of the stack (xt). Stops if the item on the top of the stack is not a number or is out of range, but doesnt yet report any errors. If the number is valid, then runs the word with the designated compilation address (xt). |
exponentation | exponentation or power function yx | generic stack language mathematics |
---|---|---|
n1|u1 n2|u2 --- n3 | ||
Checks to make sure there is at least two objects on the stack and that the objects on the top of the stack are numeric (either binary number or a character string that can be converted into a number). Stops without action (other than error report) if either test fails. If the objects on the top of the stack are a valid numbers, computes the exponenation function of the lower number (n1 or u1) to the power of the top number (n2 or u2), n1n2, and pushes this answer (n3) to the top of the stack. |
forward | forward | Turtle Graphics graphics |
---|---|---|
color steplength strokewidth --- | ||
Moves the turtle forward one step. If the pen is down, a line is drawn. If the turtle is in show mode, then the turtle is shown. The order of objects expected on the top of the stack are: color, steplength, and strokewidth. |
ge | greater than or eqqual to (equality test) | PostScript boolean, relational |
---|---|---|
num1|string1 num2|string2 --- bool | ||
Pops and compares the two top objects on the stack. If the second object from the top of the stack (num1 or string1) is greater than or equal to the object on the top of the stack (num2 or string2), pushes Boolean true (bool) to the stack. Otherwise pushes Boolean false (bool) to the stack. Checks to guarantee there are at least two objects on the stack and stops if the test fails. Implementation note: Currently only works for binary numbers (integer and floating point numbers of same value are considered equal). |
gt | greater than (equality test) | PostScript boolean, relational |
---|---|---|
num1|string1 num2|string2 --- bool | ||
Pops and compares the two top objects on the stack. If the second object from the top of the stack (num1 or string1) is greater than the object on the top of the stack (num2 or string2), pushes Boolean true (bool) to the stack. Otherwise pushes Boolean false (bool) to the stack. Checks to guarantee there are at least two objects on the stack and stops if the test fails. Implementation note: Currently only works for binary numbers (integer and floating point numbers of same value are considered equal). |
here | here | Forth CORE system |
---|---|---|
--- addr | ||
Pushes the numeric address of the next open memory cell location (addr) to the top of the stack. |
hexstringtocharacter | hexstringtocharacter | generic stack language string |
---|---|---|
string --- character | ||
Converts the string (which should be only hexadecimal characters) to a character based on the Unicode or UTF encoding system. If the string encodes multiple UTF characters, only the right most chracter is converted. |
hide | hide | Turtle Graphics graphics |
---|---|---|
--- | ||
Hides the turtle. |
home | hide | Turtle Graphics graphics |
---|---|---|
--- | ||
Returns the turtle to the home position (normally the center of the canvas). |
idiv | integer divide | PostScript mathematics |
---|---|---|
num1 num2 --- quotient | ||
An integer-only divide (we preempted the normal Forth / (divide) word for floating point divides). Pops the top two items on the stack and divides them, then pushes the total (quotient) to the top of the stack. The number on the top of the stack (num2) is divided from the number second on the stack (num1). Example: algebriac notation 5/2 = would be converted into RPN (stack) notation 5 2 idiv . (answer 2). Checks to confirm that both of the top two objects on the stack are numbers (either as binary numbers or as character strings that convert to numbers) or if there are less than two objects on the stack. Stops without action (other than error report) if either test fails. |
le | less than or eqqual to (equality test) | PostScript boolean, relational |
---|---|---|
num1|string1 num2|string2 --- bool | ||
Pops and compares the two top objects on the stack. If the second object from the top of the stack (num1 or string1) is less than or equal to the object on the top of the stack (num2 or string2), pushes Boolean true (bool) to the stack. Otherwise pushes Boolean false (bool) to the stack. Checks to guarantee there are at least two objects on the stack and stops if the test fails. Implementation note: Currently only works for binary numbers (integer and floating point numbers of same value are considered equal). |
left | left | Turtle Graphics graphics |
---|---|---|
d --- | ||
Turns the turtle to the left. Expects the number of degrees to turn to the left to be the top item on the stack (d). Modulus 360 applies to the number. Negative numbers reverse the direction of the turn. |
ln2 | natural logarithm of 2 | generic stack language mathematics |
---|---|---|
--- n | ||
Places the natural logarithm of 2 (n) on the top of the stack (approximately 0.693). |
ln10 | natural logarithm of 10 | generic stack language mathematics |
---|---|---|
--- n | ||
Places the natural logarithm of 10 (n) on the top of the stack (approximately 2.302). |
log | natural logarithm loge | generic stack language mathematics |
---|---|---|
n1|u1 --- n2 | ||
Checks to make sure there is at least one object on the stack and that the object on the top of the stack is numeric (either binary number or a character string that can be converted into a number). Stops without action (other than error report) if either test fails. If the object on the top of the stack is a valid number (n1 or u1), computes the natural logarithm (n1), loge, and pushes this answer (n2) to the top of the stack. |
log10 | decimal logarithm log10 | generic stack language mathematics |
---|---|---|
n1|u1 --- n2 | ||
Checks to make sure there is at least one object on the stack and that the object on the top of the stack is numeric (either binary number or a character string that can be converted into a number). Stops without action (other than error report) if either test fails. If the object on the top of the stack is a valid number (n1 or u1), computes the decimal logarithm (n1), log10, and pushes this answer (n2) to the top of the stack. |
log2e | base-2 logarithm of E | generic stack language mathematics |
---|---|---|
--- n | ||
Places the base-2 logarithm of Eulers number (n) on the top of the stack (approximately 1.442). |
log10e | base-10 logarithm of E | generic stack language mathematics |
---|---|---|
--- n | ||
Places the base-10 logarithm of Eulers number (n) on the top of the stack (approximately 0.434). |
lt | less than (equality test) | PostScript boolean, relational |
---|---|---|
num1|string1 num2|string2 --- bool | ||
Pops and compares the two top objects on the stack. If the second object from the top of the stack (num1 or string1) is less than the object on the top of the stack (num2 or string2), pushes Boolean true (bool) to the stack. Otherwise pushes Boolean false (bool) to the stack. Checks to guarantee there are at least two objects on the stack and stops if the test fails. Implementation note: Currently only works for binary numbers (integer and floating point numbers of same value are considered equal). |
max | maximum | Forth CORE mathematics |
---|---|---|
n1|u1 n2|u2 --- n3 | ||
num1 num2 --- num3 | ||
Pops the top item from the stack (n1 or u1 or num1) and the second item from the top (n2 or u2 or num2), then pushes the maximum (larger) of the two numbers (n3 or num3) to the top of the stack. Checks to confirm that there is at least two items on the stack and the top two objects on the stack are both numbers (either a binary number or a character string that convert to numbers). Stops without action (other than error report) if either test fails. |
min | minimum | Forth CORE mathematics |
---|---|---|
n1|u1 n2|u2 --- n3 | ||
num1 num2 --- num3 | ||
Pops the top item from the stack (n1 or u1 or num1) and the second item from the top (n2 or u2 or num2), then pushes the minimum (smaller) of the two numbers (n3 or num3) to the top of the stack. Checks to confirm that there is at least two items on the stack and the top two objects on the stack are both numbers (either a binary number or a character string that convert to numbers). Stops without action (other than error report) if either test fails. |
mod | modulus | Forth CORE/PostScript stack |
---|---|---|
n1 n2 --- n3 | ||
int1 int2 --- remainder | ||
Pops the top two items on the stack and determines the modulus, then pushes the result (n3 or remainder) to the top of the stack. The number on the top of the stack (n2 or int2) is mod from the number second on the stack (n1 or int1). Example: algebriac notation 5 mod 3 = would be converted into RPN (stack) notation 5 3 mod . (the answer to the previous equation is 2) Checks to confirm that both of the top two objects on the stack are numbers (either as binary numbers or as character strings that convert to numbers). Stops without action (other than error report) if either test fails or if there are less than two objects on the stack. |
mul | multiply or multipication | PostScript mathematics |
---|---|---|
num1 num2 --- product | ||
Pops the top two items on the stack and multiplies the top number (num2) by the second to top number (num1), then pushes the total (product) to the top of the stack. Checks to confirm that both of the top two objects on the stack are numbers (either as binary numbers or as character strings that convert to numbers). Stops without action (other than error report) if either test fails or if there are less than two objects on the stack. |
naturalantilograithm | natural antilogarithm ex | generic stack language mathematics |
---|---|---|
n1|u1 --- n2 | ||
Checks to make sure there is at least one object on the stack and that the object on the top of the stack is numeric (either binary number or a character string that can be converted into a number). Stops without action (other than error report) if either test fails. If the object on the top of the stack is a valid number (n1 or u1), computes the natural antilogarithm of en1 (n1) and pushes this answer (n2) to the top of the stack. |
ne | not equal (equality test) | PostScript boolean, relational |
---|---|---|
any1 any2 --- bool | ||
Pops and compares the two top objects on the stack. If the second object on the stack (any1) is not equal to the top object on the stack (any2), pushes Boolean true (bool) to the stack. Otherwise pushes Boolean false (bool) to the stack. Checks to guarantee there are at least two objects on the stack and stops if the test fails. Implementation note: Currently only works for binary numbers (integer and floating point numbers of same value are considered equal). |
neg | unary negate or unary negation | PostScript mathematics |
---|---|---|
num1 --- num2 | ||
Negate the number on the top of the stack (num1), giving the arithmetic inverse (num2). Checks to confirm that there is at least one item on the stack and the top object on the stack is a number (either a binary number or a character string that convert to numbers). Stops without action (other than error report) if either test fails. |
negate | unary negate | Forth CORE mathematics |
---|---|---|
n1 --- n2 | ||
Negate the number on the top of the stack (n1), giving the arithmetic inverse (n2). Checks to confirm that there is at least one item on the stack and the top object on the stack is a number (either a binary number or a character string that convert to numbers). Stops without action (other than error report) if either test fails. |
pendown | pendown | Turtle Graphics graphics |
---|---|---|
--- | ||
description |
penup | penup | Turtle Graphics graphics |
---|---|---|
--- | ||
Lifts the turtles pen. Causes the turtle to stop drawing when it moves. |
pi | pi | generic stack language mathematics |
---|---|---|
--- n | ||
Places pi (n) on the top of the stack (approximately 3.14). Also can use the actual character π. |
pop | pop | PostScript stack |
---|---|---|
any --- | ||
Pops the top object (any) from the stack. |
radianstodegrees | radians to degrees conversion | generic stack language mathematics |
---|---|---|
n1|u1 --- n2 | ||
Checks to make sure there is at least one object on the stack and that the object on the top of the stack is numeric (either binary number or a character string that can be converted into a number). Stops without action (other than error report) if either test fails. If the object on the top of the stack is a valid number (n1 or u1), converts the number (n1 or u1) from radians to degree and pushes this answer (n2) to the top of the stack. |
reciprocal | reciprocal | generic stack language mathematics |
---|---|---|
n1|u1 --- n2 | ||
Checks to make sure there is at least one object on the stack and that the object on the top of the stack is numeric (either binary number or a character string that can be converted into a number). Stops without action (other than error report) if either test fails. If the object on the top of the stack is a valid number (n1 or u1), computes the reciprocal of 1/x (n1) and pushes this answer (n2) to the top of the stack. |
resetgrafx | reset grafx | Turtle Graphics graphics |
---|---|---|
--- | ||
Clears the canvas and resets the turtle to the initial drawing context (other than background color). |
right | right | Turtle Graphics graphics |
---|---|---|
d --- | ||
Turns the turtle to the right. Expects the number of degrees to turn to the right to be the top item on the stack (d). Modulus 360 applies to the number. Negative numbers reverse the direction of the turn. |
sec | secant | generic stack language mathematics |
---|---|---|
n1|u1 --- n2 | ||
Checks to make sure there is at least one object on the stack and that the object on the top of the stack is numeric (either binary number or a character string that can be converted into a number). Stops without action (other than error report) if either test fails. If the object on the top of the stack is a valid number (n1 or u1), computes the trigonometric secant function of sec(n1), n1 being in radians and pushes this answer (n2) to the top of the stack. |
setbackground | set background | Turtle Graphics graphics |
---|---|---|
color --- | ||
Sets the color of the background in the canvas. Expects the new background color (color) to be on the top of the stack as a string in any of the three color formats accepted by JavaScript. |
show | show | Turtle Graphics graphics |
---|---|---|
--- | ||
Shows the turtle. |
sin | sine | generic stack language mathematics |
---|---|---|
n1|u1 --- n2 | ||
Checks to make sure there is at least one object on the stack and that the object on the top of the stack is numeric (either binary number or a character string that can be converted into a number). Stops without action (other than error report) if either test fails. If the object on the top of the stack is a valid number (n1 or u1), computes the trigonometric sine function of sin(n1), n1 being in radians and pushes this answer (n2) to the top of the stack. |
squareroot | square root or √ | generic stack language mathematics |
---|---|---|
n1|u1 --- n2 | ||
Checks to make sure there is at least one object on the stack and that the object on the top of the stack is numeric (either binary number or a character string that can be converted into a number). Stops without action (other than error report) if either test fails. If the object on the top of the stack is a valid number (n1 or u1), computes the square root function of √(n1), n1 being in radians and pushes this answer (n2) to the top of the stack. |
sqrt1/2 | square root of one half or √ 1/2 | generic stack language mathematics |
---|---|---|
--- n | ||
Places the square root of 1/2 (one half) (n) on the top of the stack (approximately 0.707). |
sqrt1_2 | square root of one half or √ 1/2 | generic stack language mathematics |
---|---|---|
--- n | ||
Places the square root of 1/2 (one half) (n) on the top of the stack (approximately 0.707). |
sqrt2 | square root of two or √ 2 | generic stack language mathematics |
---|---|---|
--- n | ||
Places the square root of two (n) on the top of the stack (approximately 1.414). |
sub | subtract or subtraction | PostScript mathematics |
---|---|---|
num1 num2 --- difference | ||
Pops the top two items on the stack and subtracts them, then pushes the total (difference) to the top of the stack. The number on the top of the stack (num2) is subtracted from the number second on the stack (num1). Example: algebriac notation 3 - 2 = would be converted into RPN (stack) notation 3 2 sub . (answer is 1) Checks to confirm that both of the top two objects on the stack are numbers (either as binary numbers or as character strings that convert to numbers). Stops without action (other than error report) if either test fails or if there are less than two objects on the stack. |
swap | swap | Forth CORE stack |
---|---|---|
x1 x2 --- x2 x1 | ||
Swaps the top two objects (x1 and x2) on the stack. Checks to guaranatee that there at least two objects on the stack and stops with error if there are only one or zero items on the stack. Same functionality as PostScripts exch. |
tan | tangent | generic stack language mathematics |
---|---|---|
n1|u1 --- n2 | ||
Checks to make sure there is at least one object on the stack and that the object on the top of the stack is numeric (either binary number or a character string that can be converted into a number). Stops without action (other than error report) if either test fails. If the object on the top of the stack is a valid number (n1 or u1), computes the trigonometric tangent function of tan(n1), n1 being in radians and pushes this answer (n2) to the top of the stack. |
π | pi | generic stack language mathematics |
---|---|---|
--- n | ||
Places pi (n) on the top of the stack (approximately 3.14). Also can use the word pi. |
√ | square root | generic stack language mathematics |
---|---|---|
n1|u1 --- n2 | ||
Checks to make sure there is at least one object on the stack and that the object on the top of the stack is numeric (either binary number or a character string that can be converted into a number). Stops without action (other than error report) if either test fails. If the object on the top of the stack is a valid number (n1 or u1), computes the square root function of √(n1), n1 being in radians and pushes this answer (n2) to the top of the stack. |
Distributed by Twiddledom.
Copyright © 2014, 2015 Milo
Licensed under the MIT License. You may obtain a copy of the License at
http://opensource.org/licenses/MIT
The MIT License (MIT)
Copyright © 2014, 2015 Milo
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Check back for new versions of this software, updated weekly.
watch for version number to change
You can help support this project by donating to the Someone Cares Soup Kitchen and Tutoring Program. They are the primary source of food for the author and programmer of this project.
Someone Cares Soup Kitchen:
has served more than 300 meals a day for more than 28 years.
feeds the hungry for around $1.30 per person!
feeds 58% of the homeless in Orange County.
feeds low income families.
feeds the elderly on limited Social Security.
720 West 19th Street
Costa Mesa, California, USA 92627
Make donations at: http://www.someonecareskitchen.org/pages/help.html. The director of Someone Cares has aksed that you leave a note saying why you donated.
I simply dont have all of the software and other resources to make this video esily visible for every web browser. I cant make either webm or ogg versions. I have to combine hosting leftovers from other people, leading to cross platform and third party problems.
If the video doesnt work automatically, try save link as or download and view the movie in your local media player. The hard link is http://www.twiddledom.com/a/movie.mp4.
All of the major operating systems have a free player that will handle this mp4 file (Microsofts Windows Media Player, Apples iTunes or QuickTime Player, Reals RealPlayer), Linuxs MPV, SMPlayer, GNOME Videos, VLC, or Mplayer.
Cryptologists can use letter frequency to breka the most simple codes. The order of frequency of letter use varies by language and subject area, but one common order for the English language in general is: ETAON RISHD LFCMU GYPWB VKJXQ Z (from Herbert S. Zims classic Codes and Secret Writing).
Comonly listed five least frequently used letters in the English language include: zxqjk zxpbð (Old English), zxqjv (Bible), zxqjk (Linotype machines), qyzcx (International Morse Code), ZQXJK (Herbert S. Zim), zqxjk (from Oxford English Dictionary), xzyqk (first letter of words).