Short intro to Pasteltalk

Bror Arnfast

Download the Pasteltalk program for Windows here

or start the machine in a browser (allow your browser to install adobe shockwave if you dont have that plug-in already)

 

 

 

 Ill. The Pasteltalk interface

 

With Pasteltalk you can achieve an understanding of these concepts by experimenting:

List of basic instructions of Pasteltalk

 

Coordinate system, lines and angles

The coordinate system is defined un-mathematical like in Flash, Director and webbrowsere e.g. X-axis direction is to the right and Y-axis direction is DOWN.

The unit for the coordinates is a pixel.

Angles are declared in degrees and positive numbers turns clockwise.

Lines can be drawn in different widths but may show holes and edges when the stroke is larger than 1.

Colours and surfaces

Colours are defined by three values between 0 and 255 representing Red, Green og Blue respectively.

Rectangle takes 4 parameters being the x and y coordinat for one corner and x and y coordinates for the opposite corner.

Oval takes parameters as well, defining the rectangle that encloses the oval. (Remember a circle is just a square oval.)

 

Built in functions

abs(x)

absolute value, abs(2)=2, abs(-2)=2, abs(1.35)=1.35,  abs(-1.35)=1.35

 

atan(x)

arctangent,  atan(1)=0.7854   (please note here angles are given in radians)

 

cos(x)

cosinus,  cos(1)=0.5403

 

date()

a=date() ,  a will get the string value of today e.g.: "03-01-2005"

 

exp(x)

e in the power of x   (e being the natural logarithm base number)

 

integer(x)

rounds x to nearest integer, integer(3.75)=4

 

log(x)

the natural logarithm of x,  log(4.3)=1.4586

 

PI, pi

(pi is not a function but rather a constant) PI=3.1416

 

power(a,x)

puts a in the power of x,  power(4,3)=64 = 4*4*4

 

random(x)

returns a random integer between 1 and x,  random(5)=3 (or maybe 2? 1? 4? or 5?)

 

sin(x)

the sine of x, sin(1.57)=1.0000 (note: angles in radians)

 

sqrt(x)

square root of x,  sqrt(100)=10

 

tan(x)

tangent of x, tan(2.0)= -2.1850  (note: angles in radians)

 

time()

the computer clock, a=time() ,  a gets the string value of the system clock e.g.: "09:45 "

 

The functions date() and time() who returns strings are not very usefull in this context but we can see the values in the variable window if we assign the function to a variable.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Examples

walk(60)

turn(45)

.. after 6 clicks on DO-IT


base;

newcanvas;

newcolor(220,230,175);

oval(50,50,250,250);

newcolor(175,230,230);

oval(100,100,200,200);

newcolor(230,160,255);

oval(130,130,170,170);

Ovals can be circles


Train wagon


function square6(side){

walk(side)

turn(90)

walk(side)

turn(90)

walk(side)

turn(90)

walk(side)

turn(90)

walk(side)

turn(90)

walk(side)

}

 

newcanvas

base

a=1

b=2

for (i=1;i<20;i++){

c=a+b

a=b

b=c

square6(c)

}

 

Fibonacci


Recursion


Artwork by Jan Skovgård