langs a-z
This commit is contained in:
parent
db842d013d
commit
d066446780
11389 changed files with 98361 additions and 1020 deletions
|
|
@ -0,0 +1,52 @@
|
|||
/* Plot three circles. */
|
||||
|
||||
CIRCLE: PROCEDURE OPTIONS (MAIN);
|
||||
declare image (-20:20, -20:20) character (1);
|
||||
declare j fixed binary;
|
||||
|
||||
image = '.';
|
||||
image(0,*) = '-';
|
||||
image(*,0) = '|';
|
||||
image(0,0) = '+';
|
||||
|
||||
CALL DRAW_CIRCLE (0, 0, 11);
|
||||
CALL DRAW_CIRCLE (0, 0, 8);
|
||||
CALL DRAW_CIRCLE (0, 0, 19);
|
||||
|
||||
do j = hbound(image,1) to lbound(image,1) by -1;
|
||||
put skip edit (image(j,*)) (a(1));
|
||||
end;
|
||||
|
||||
draw_circle: procedure (x0, y0, radius); /* 14 May 2010. */
|
||||
declare ( x0, y0, radius ) fixed binary;
|
||||
declare ( ddfx, ddfy, x, y, f ) fixed binary;
|
||||
declare debug bit (1) aligned static initial ('0'b);
|
||||
|
||||
f = 1-radius;
|
||||
ddfx = 1;
|
||||
ddfy = -2*radius;
|
||||
x = 0;
|
||||
y = radius;
|
||||
image(x0, y0+radius) = '*'; /* Octet 0. */
|
||||
image(x0+radius, y0) = '*'; /* Octet 1. */
|
||||
image(x0, y0-radius) = '*'; /* Octet 2. */
|
||||
image(x0-radius, y0) = '*'; /* Octet 3. */
|
||||
|
||||
do while (x < y);
|
||||
if f >= 0 then
|
||||
do; y = y - 1; ddfy = ddfy +2; f = f + ddfy; end;
|
||||
x = x + 1;
|
||||
ddfx = ddfx + 2;
|
||||
f = f + ddfx;
|
||||
image(x0+x, y0+y) = '0'; /* Draws octant 0. */
|
||||
image(x0+y, y0+x) = '1'; /* Draws octant 1. */
|
||||
image(x0+y, y0-x) = '2'; /* Draws octant 2. */
|
||||
image(x0+x, y0-y) = '3'; /* Draws octant 3. */
|
||||
image(x0-x, y0-y) = '4'; /* Draws octant 4. */
|
||||
image(x0-y, y0-x) = '5'; /* Draws octant 5. */
|
||||
image(x0-y, y0+x) = '6'; /* Draws octant 6. */
|
||||
image(x0-x, y0+y) = '7'; /* Draws octant 7. */
|
||||
end;
|
||||
end draw_circle;
|
||||
|
||||
END CIRCLE;
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
....................|....................
|
||||
................2222*1111................
|
||||
.............222....|....111.............
|
||||
...........22.......|.......11...........
|
||||
..........2.........|.........1..........
|
||||
........22..........|..........11........
|
||||
.......3............|............0.......
|
||||
......2.............|.............1......
|
||||
.....3..............|..............0.....
|
||||
.....3...........222*111...........0.....
|
||||
....3..........22...|...11..........0....
|
||||
...3..........2.....|.....1..........0...
|
||||
...3........32....22*11....11........0...
|
||||
..3.........3...22..|..11...0.........0..
|
||||
..3........3...3....|....0...0........0..
|
||||
..3.......3...2.....|.....1...0.......0..
|
||||
.3........3..3......|......0..0........0.
|
||||
.3.......3...3......|......0...0.......0.
|
||||
.3.......3..3.......|.......0..0.......0.
|
||||
.3.......3..3.......|.......0..0.......0.
|
||||
-*-------*--*-------+-------*--*-------*-
|
||||
.4.......4..4.......|.......7..7.......7.
|
||||
.4.......4..4.......|.......7..7.......7.
|
||||
.4.......4...4......|......7...7.......7.
|
||||
.4........4..4......|......7..7........7.
|
||||
..4.......4...5.....|.....6...7.......7..
|
||||
..4........4...4....|....7...7........7..
|
||||
..4.........4...55..|..66...7.........7..
|
||||
...4........55....55*66....67........7...
|
||||
...4..........5.....|.....6..........7...
|
||||
....4..........55...|...66..........7....
|
||||
.....4...........555*666...........7.....
|
||||
.....4..............|..............7.....
|
||||
......5.............|.............6......
|
||||
.......4............|............7.......
|
||||
........55..........|..........66........
|
||||
..........5.........|.........6..........
|
||||
...........55.......|.......66...........
|
||||
.............555....|....666.............
|
||||
................5555*6666................
|
||||
....................|....................
|
||||
Loading…
Add table
Add a link
Reference in a new issue