|
|
Designed for computer science instruction, Turing is simply the
easiest, most fun, and most effective way of teaching programming concepts.
|
Quick Links |
|
|
Introduction to Turing
Turing (OOT) is a general purpose programming language designed specifically
for teaching the concepts of computer science. It features easy to learn
syntax combined with an environment that catches many common programming
errors such as uninitialized and undeclared variables, dangling pointers
and so forth.
Turing features an easy to learn syntax that provides strong error checking
to make programming easier. Semicolons are not required. Declarations can
appear wherever statements can appear. While Turing is a completely "safe"
language, providing no direct access to the hardware, it also includes
concurrency, exception handling, objects, classes and inheritance, and
systems programming language features, allowing students to begin to learn
the concepts of object-oriented programming in a familiar student-friendly
environment.
Turing has a student-friendly, integrated programming environment. It is
designed to get students writing programs quickly without spending time
learning the details of the environment. Environment commands are
straightforward and easy to find. The Turing environment is also designed
for easy administration on school networks.
Features of the environment include:
- allows teachers to choose between a simple single-window mode or a multi-window mode for more experienced programming students,
- one-button program indentation,
- one button compilation and execution,
- syntax colouring,
- easy to understand error messages,
- direct access to the PC parallel port ( for computer engineering courses).
Turing includes all the standard features of a procedural programming
language. It includes:
- convenient strings and input/output,
- if statements with elsif clauses,
- case statements with otherwise clauses,
- loop statements with exits,
- modules with import and export,
- dynamic arrays and parameters,
- assertions (assert, pre, post and invariant),
- type transfer functions (such as string to real),
- random number generation,
- exponentiation, and
- run-time constants.
Here is a complete Turing program that repeatedly picks a random number from
1 to 6 until it picks a 6.
% Roll a die until you get 6. (This line is a comment)
var die : int
loop
randint (die, 1, 6)
exit when die = 6
put "This roll is ", die
end loop
put "Stopping with roll of 6"
Turing provides extensive support for graphics, allowing teachers to
capitalize on student interest in graphics and animation early in the
programming course. Turing makes it very easy for students to use
features, including:
- drawing primitives (lines, rectangles, ovals, stars and maple leaves),
- loading graphics files (BMP, and Macintosh PICT),
- simple animation,
- sound, and
- music.
Here is a complete Turing program that draws randomly colored stars in a
night sky.
var x, y, clr : int % The location and color of the star
drawfillbox (0, 0, maxx, maxy, black) % Make the window black
drawline (0, 100, maxx, 100, white) % Draw the horizon
for i : 1 .. 40
randint (x, 0, maxx) % Set the x position
randint (y, 100, maxy) % Set the y position
randint (clr, 0, maxcolor) % Set the color
drawfillstar (x, y, x + 20, y + 20, clr) % Draw the star
end for
This example also demonstrates the maxx, maxy, maxcolor
functions that make it easy to write programs for any screen resolution and
any platform. Students can write programs that run on their Macintosh's at
home as easily as their PC's at school.
Turing contains a set of Object Oriented features that make teaching
Object Oriented Programming easy. Note that use of these features are
completely optional. You can teach either standard structured programming
or object oriented programming using Turing.
The core object-oriented features of Turing are easy to learn, so
programmers can read programs and understand them quickly and easily.
Programs consist of units which are objects (called modules) or classes.
These units exist as separate items in the environment and the user has
immediate access to use (or re-use) these units in his/her program.
Here is a program that implements complex numbers.
class Complex
export Set, GetReal, GetImaginary, Add, Multiply
var realComponent, imaginaryComponent : real
procedure Set (r, imag : real)
realComponent := r
imaginaryComponent := imag
end Set
function GetReal : real
result realComponent
end GetReal
function GetImaginary : real
result imaginaryComponent
end GetImaginary
procedure Add (number : ^Complex)
realComponent += number -> GetReal
imaginaryComponent += number -> GetImaginary
end Add
procedure Multiply (number : ^Complex)
realComponent := realComponent * number -> GetReal -
imaginaryComponent * number -> GetImaginary
imaginaryComponent := realComponent * number -> GetImaginary +
imaginaryComponent * number -> GetReal
end Multiply
end Complex
% Main program
var x, y, z : ^Complex
new x % Create the x object
new y % Create the y object
new z % Create the z object
x -> Set (5, 0) % x = 5
y -> Set (0, 5) % y = 5i
z -> Set (3, 3) % z = 3 + 3i
x -> Add (y);
x -> Multiply (z);
put "x = ", x -> GetReal, " + ", x -> GetImaginary, "i"
Turing includes features such as:
- natural (unsigned) numbers,
- sized numbers (e.g., nat1 is a one-byte natural number),
- bit manipulation,
- subprograms as variables,
- characters and fixed length character strings,
- explicit type cheats (e.g., #c treats any value c as a nat1),
- indirection (e.g., int@(16#8ab36) is a peek or poke to hex location 8ab36),
- concurrency with dynamic forking and monitors,
- interrupt handling procedures,
- completely checked separate compilation,
- exception handlers,
- binary and random access input/output, and
- conditional compilation.
Versions of Turing exist for the Microsoft Windows, Apple Macintosh and
Linux platforms. The Turing language is identical between platforms and
files are straight ASCII, enabling students to seamlessly transfer programs
from home to school regardless of platform. (Note: There are some differences
between the platforms with regards to advanced graphics usage and font
availability.)
Turing's system requirements are a low as possible so that schools can
utilize any available lab. Turing is designed to run either over a network
or installed on individual machines.
| Microsoft Windows |
Windows 95/98/Me/NT/2000/XP 16MB RAM 6 MB Hard Drive Space |
| Apple Macintosh |
System 7.1 16MB RAM 4 MB Hard Drive Space |
| Linux |
16MB RAM 6 MB Hard Drive Space |
Turing is available for purchase either as a site license for an entire
school or purchased as individual units. A site license enabling a school
to redistribute the software free of charge to its students is also
available.
For pricing, click here.
[ Turing Home ] *
[ Top of Page ] *
[ Feedback ]