Quick keyboard commands
(shortcuts)
| command |
short cut |
command |
short cut |
| Control + Z |
Undo |
Shift + Arrows |
Highlight & select |
| Control + C |
Copy |
Control + V |
Paste |
| Control + R |
Run |
Alt + F4 |
Close active window |
| Control + P |
Print |
|
|
| |
|
|
|
Start using Turing
TURING FOR WINDOWS
– Object Oriented Programming Version 3.1.1
INSTRUCTIONS:
STARTING THE TURING PROGRAMMING
INTERFACE
From
Windows:
1. Click on START
2. Go to PROGRAMS
3. Click on OOT for Windows 3.1.1
4. Click on Continue
5. Click on Start Up OOT

6. Maximize the
(unnamed) OOT Editor.
This is the Turing
Programming Environment you will be
using to write your programs.
Program Example
The “PUT” command
The Put command will send an output to
the screen.
Syntax:
(This is what you type in the Turing [OOT] interface)
The
proper syntax for the PUT command to display the word “HELLO” on the screen is
as follows
(type the following command in the OOT interface)
put “Hello”
When you click on the
Run (or type CONTROL + R) Button (on the OOT Editor) it will execute the program
and display the word Hello on a separate window.
This table summarizes the most
common commands -- memorize it!
| Command |
Function |
| put |
displays a variable or outputs information on the screen |
| get |
obtain a variable from a user or inputs a variable into
the program |
| drawdot |
draws a dot |
| drawline |
draws a line |
| drawbox |
draws a box |
| drawoval |
draws a circle, an oval, or an ellipse |
| drawfill |
draws and fills a shape with a given colour |
| locate |
locates pixels |
| locatexy |
locates a point with co-ordinates (x , y) on
the screen |
| var |
reserves a space in the computer's memory for |
| cls |
clears the screen |
| colorback |
changes the back ground colour |
| for and loop |
used to start a looping sequence -- a counter |
| end for and end loop |
end the looping sequence or counter |
Additional Reference and exercises:
Computer
Engineering – An Activities Based Approach Smyth & Stevenson, Holt Software,
Toronto - 2000 -
Chapter 6
Color
Codes for Programming in Turing
The "COLOR" command in Turing allows you to change the colour
of a character, a background, or a graphics.
The syntax for the COLOR command is:
where "colorNumber" can be replaced with any of the following codes
| NUMBER |
COLOUR |
NUMBER |
COLOUR |
NUMBER |
COLOUR |
NUMBER |
COLOUR |
| 0 |
black |
1 |
blue |
2 |
green |
3 |
cyan |
| NUMBER |
COLOUR |
NUMBER |
COLOUR |
NUMBER |
COLOUR |
NUMBER |
COLOUR |
| 4 |
red |
5 |
magenta |
6 |
brown |
7 |
white |
| NUMBER |
COLOUR |
NUMBER |
COLOUR |
NUMBER |
COLOUR |
NUMBER |
COLOUR |
| 8 |
dark gray |
9 |
light blue |
10 |
light green |
12 |
light red |
| NUMBER |
COLOUR |
NUMBER |
COLOUR |
NUMBER |
COLOUR |
NUMBER |
COLOUR |
| 13 |
light magenta |
14 |
light yellow |
15 |
gray |
|
|
The % Symbol
placed in front of any line will change whatever follows into a comment.
Command placed after the % sign in a line will be treated as comments as well
and will not be executed.
| The Clear Screen
Command "cls" is used to reset the background colour, or clear the
screen for additional information to be displayed |
Example 1.
The following program will change the colour of the background to white and
draw a black dot at position (50, 50); i.e. (50 pixels from the left hand corner
of the screen, and 50 pixels up).
Try it
setscreen ("graphics: vga")
% this will set the graphic display mode in VGA format
colorback (15)
% this changes the background colour to gray
cls
% clear the screen for additional input
drawdot (50,50,0)
% this draws a black dot -- colour "0" at position (50,50)
|
|