FIRST EXAMPLES


FULL SEQUENCE
INTERACTIVE CALCULATIONS
A LITTLE grahique 2D
A LITTLE grahique 3D



















































FULL SEQUENCE

Starting the program

       Under Windows click on anyflo_no_gra.exe
       The program runs and prints some.
       The interpreter is ready and waiting for a command.

Firsts steps

Type:
       help;
The list of commands is displayed.
Type:
       help cos;
Prints the command description cos.
Type:
       $help(0)cos;
Prints the content of file de cos.0.htm
Type:
       $help(1)vol;
Prints the content of file vol.1.htm

Another method is to click on the file
       AIDE_ANYFLO.htm (help on the machine), or
      
AIDE_ANYFLO_WEB.htm (online help: requires an internet connexion),
which give access to hypertext help.

Type:
       demo for; Command for demo is launched.

Type:
       bye; Message "SEE YOU SOON!..." appears and the program is stopped.

INTERACTIVE CALCULATIONS

Calculations
Variables
Arrays
Indices
pointers

Calculations

Type:
       1+2*3;
       Nothing happens.
Type:
       print(1+2*3);
       The result 7 appears.
Type:
       $(1+2*3);
       The result 7 appears: $ stands for print.
Type:
       $1+2*3;
       The result 7 appears: you can forget parentheses if there is no ambiguity.

Variables

Type:
       x=1+2*3;
       Nothing happens.
Type:
       $x;
       The result 7 appears: the variable x is initialized to the value 7.
Type:
       x=1,2,3,4,5;$x;
       The result (1.0,2.0,3.0,4.0,5.0) appears:
       A variable can also be an array.
Type:
       x=[1,5];$x;
       The result (1.0,2.0,3.0,4.0,5.0) appears:
       A series of consecutive values ??can be defined by its boundaries.
Exercises:
       1) x=[5,1];$x;
       2) x=[10,100,10];$x;
Type:
       x="toto";$x;
       The result toto appears:
A variable can also be a string.
       3) Type:
       x=[1,5],"ABCD",-1;
       Then
       $x;
       The result (1.2,2.0,3.0,4.0,5.0)(ABCD)(-1.0) appears:
       a variable can be hybrid.
Type:
       x=1;y=2;z=3;$x+y*z;
       The result 7 appears.

Arrays

Taper:
       x=[1,5];y=[6,10];$x+y;
       The result (7.0,9.0,11.0,13.0,15.0) appears:
       The number calculations are extended toarrays.
Taper:
       $x,y;
       The result (1.0,2.0,3.0,4.0,5.0,6.0,7.0,8.0,9.0,10.0)appears:
       The comma is the concatenation operator.
Exercises:
       1) x=[1,5];$1+2*x;
       2) x=[1,5];y=[6,12];$x+2*y;
       3) $x,1+2*y;

Indices

Taper:
       x=[1,12];$x[0];
       The result 1 appears: x[i] returns the element of rank i of the variable x.
Note:
       Indices start at 0, and x [3] returns 4 and [12] causes an error (12: ILLEGAL INDEX).
Exercises:
       1) x=[1,12];$x[0,4];
       2) $x[4,0];
       3) x[0,4]=[14,10];$x;
       4) x=[1,12];x[0,5]=x[11,6];$x;
Type:
       edit x;
       The variable x is printed as a list of 3D points:
0: 1.0 2.0 3.0
1: 4.0 5.0 6.0
2: 7.0 8.0 9.0
3: 10.0 11.0 12.0
Type:
       $x{0};
       The result(1.0,2.0,3.0) appears:
       x{i}; returns the components from the point of rank i of the variable x.
Note:
       Indices start at 0, and x {2} returns (7.0,8.0,9.0) and {4} causes an error (4: ILLEGAL INDEX).
Exercises:
       1) x=[1,12];$x{0,3};
       2) $x{3,0};
       3) x{0,2}=x{3,2};$x;
       4) x=[1,12];x{0,4}=x{4,0};$x;

pointers

Type:
t=[0,5];p=@t;$p;
p is the address of the array t.
Type:
$p[2]; produces 2 which is the number 2 of t.
Type:
edit(p[0,5]); produces:
       0.0 1.0 2.0
       3.0 4.0 5.0

A LITTLE grahique 2D

       Clixk on anyflo_video.exe, window size graphic video opens, it can hide the text window to retrieve it simultaneously press the keys Alt and Tab then click on anyflo.exe.
Type:
       screen;
       The blue screen is cleared (default background color).
Taper:
       screen 1,.7,.5;
       The screen is cleared in orange: The colors are defined by their components (red, green, blue) normalized between 0.0 and 1.0
Type:
       screen;
       The blue screen is cleared: the background color has not been changed.
Type:
       back 1;screen;
       The screen is cleared in red: the background color has been changed.
Type:
       x=arc 100,0,2*PI,12;
       x is the line of regular polygonal center the origin, radius 100, and a turn angle of 12 vertices.
       edit x; prints the coordinates of the polygonal line.
       screen;displ line(x);
       Clears the screen and displays the polygonal line x.
Type:
       segment(0,0,200,100)col(1,1,1);
       A white segment joining the points (0,0) and (200,100) is displayed. The center of the coordinates system of the screen is the center, the axis of x is taken to the right of the axis and is directed downwardly.
Type:
       segment(0,0,200,-100)col(0,1,0)cut(3,3);
       A green segment joining the points (0,0) et (200,-100) is displayed.
Type:
       frame(-100,-100,100,100)col 0,1;
       A green frame is displayed.
Type:
       rectangle(0,0,50,50)col 0,1,1;
       A cyan filled rectangle is displayed.
Exercises:
       1) screen 0;rectangle(0,0,50,50)col(1);
       2) screen 0,0,1;rectangle(50,50,-50,-50)col(1,1,1);
       3) Taper:
       demo pixel;
       demo segment;
       demo frame;
       demo rectangle;
       demo disk;
       demo text;

A LITTLE grahique 3D

       Click on anyflo_see.exe, a window of maximum size graphic opens, and a window (image) to enter the text.
Type:
       ini ini vol;
       All flags are reset and all volumes destroyed.
Type:
       ball(1);
       A volume type ball is created by default (radius 100, 6 x sections, 3 y sections, 18 facets and 24 vertices). These parameters are displayed by the command:
       edit vol(1)
Type:
       screen;displ vol
       The screen is cleared and the ball is displayed in wire.
Type:
       ball(2)dim(200)secy(12);screen;displ vol(2);
       A ball radius 200, 24 x sections, 12 y sections, 338 facets and 364 vertices, is created then displayed.
Type:
       col vol(2)=1;yes illum;screen;displ vol(2);
       Volume 2 turns red and is displayed in full (flat mode).
Type:
       illum vol(2)=2,1,.1,.1,0;screen;displ vol(2)
       Volume 2 displayed in full (with Gouraud smoothing).