. - 3GL   - 4GL   5GL  

3GL

, Internet-, - , . . . 1215 . , .


, VGA (Video Graphic Array ) SVGA (Super VGA). , () , . , (14", 15", 17", 19" ), , , (640x480, 800x600, 1024x768, 1280x1024 ), , (16 , 64 , 256 , 256 , 16 ). , . , , ( 1820), .

, (, , ). 8 , 16 .

, . . ( 0,30,4 1415- ). (pixel picture's element, " ") . , , VGA 640 , 480 , 16 (256 ) .


, . 0 (1,1), (0,0). 0 , .

Turbo Turbo Pascal QBasic , .

, (dx,dy) ( Current Point). . . , [102] . .

, ,. , , . 0 .


, , , . 2 32 , , , .

, , 0 1. / . , . 0 , . , .

- , .

RGB-

RGB -Red (), Green () Blue (). , , ' . 2, 4, 8 24 , . VGA 4 , 16 , . 6- 2 RGB-. 64 , 16. 256 18- DAC (Digital Analog Converter - , ). 256 .

( foreground color) ( background color). . 0. , , . , .

, , . . , AND, 0R, X0R. 0 , "" . X0R, , . X0R , "". .


, , , , .

QBasic : LINE, CIRCLE, DRAW . , QBasic, , Borland. , QBasic .

, QBasic "" , , . "" . , , , . 0 (, , , ) "" . DRAW , [7], , , , . , . "". 3.0 Borland "" , .

Turbo Turbo Pascal , BGI Borland Graphics Interface ( Borland). 0 , . 83 60 . BGI- [16].

, . , SetUserCharSize. Turbo , , , . setusercharsize, . ( wideDotFiii), " ." () ( WIDE_D0T_FILL). :

: x=getmaxx();

: x:=GetMaxX;

, , . , . . .


. " ", , . , .

QBasic SCREEN, :

SCREEN n [, [cs] [,ap] [,vp]]

0 , . :

n= 9 (640x350 , 16 64 )

n=12 (640x480 , 16 64 )

n=13 (320x200 , 256 256 )

cs . ( = = i) (vp = 0 vp = i) n = 9.

SCREEN 0.

, , :

: #include <graphics.h>

: uses Graph;

BGI "" initgraph:

: initgraph(&gd,&gm, "path");

: InitGraph(gd,gm,'path');

(int, integer) , (gd) (gm). , . 0 gd initgraph (gd = gd = DETECT), . . , VGAHI, 640x480 16 64 .

, , . 99% egavga.bgi, PATH autoexec.bat. . , - , "" .


closegraph:

: closegraph();

: CloseGraph;

"" , .


. 0 , , , . BGI-.

QBasic VIEW, :

VIEW (xl,yl)-(x2,y2),cf,cb

VIEW SCREEN (xl,yl)-(2,2),cf,cb

, (xi,yi), (2,2). , ( < < 639, < < 479), . cf , , , . 0 .

. (xi,yi), . . , , , . SCREEN , . . (0,0). , , .

, (10,10), 200 . (10,10). LINE , . (VIEW SCREEN) , (310,10). 0 (0,0). , , . , , , .

8_01.bas

R

SCREEN 12 :'

VIEW (10,10)-(210,210),2,1 : ' 0

LINE (0,100)-(200,100)

LINE (100,0)-(100,200)

SLEEP : '

VIEW SCREEN (310,10)-(510,210),4,14: '

LINE (310,110)-(510,110)

LINE (410,10)-(410,510)

SLEEP

END

(VIEW) , (VIEW SCREEN) . , , . STEP:

8_02.bas

R

SCREEN 12

VIEW (10,10)-(210,210),2,1

LINE STEP(0,0)-STEP.(-20,0) : ' 0

C0L0R 4 : ' -

LINE STEP(0,0)-STEP(0,-20)

C0L0R 2 : ' -

VIEW SCREEN (310,10)-(510, 210) , 4,14

LINE STEP(0,0)-STEP(-20,0)

END

( ). 20 . .

20 ( , ). , .

. , , , , , , , - , (Y = - m). QBasic . (,) WIND0W:

WIND0W (XMIN,YMIN)-(XMAX,YMAX)

, , :

8_03.bas

R

SCREEN 12

VIEW (10,10)-(410,210),2,1

LINE (400,100)- (0,100) '

WIND0W (0,-1)-(.,1) ' 0

F0R X=.l 0 6.3 STEP .1

Y=SIN(X) '

LINE -(X,Y) ' (X,Y)

NEXT X

END

BGI

setviewport:

: setviewport(xmin,ymin,xmax,ymax,clip);

TP: SetViewPort(xmin,ymin,xmax,ymax,clip);

(xmin,ymin) (xmax,ymax) , , . , , , . clip, ( , true false), -

, . clip = clip = false . 0 . , .

, , :

8_03.pas

program sinl;

uses graph; var

gd,gm,xe,ye,k:integer;

x,y,dx:double;

begin

gd:=0;

InitGraph(gd,gm,'');

dx:=0.1;

SetViewPort(10,10,410,210, false) ;

LineTo(0,200); {0 }

LineTo(400,200); LineTo(400,0);

LineTo(0,0);

{ }

Line(400,100,0,100);

for k:=0 to 63 do

begin

x:=k*dx;

y:=sin(x);

xe:=round(x*400/6.28);

{ - , }

ye:=round(100-y*100);

LineTo(,) ( }

end;

readln;

closegraph;

end.

QBasic CLS, ( , ), . 0 CLS 2 , , .

BGI ciearviewport cieardevice. , .

getmaxx getmaxy, . , . , , , :

Circle(GetMaxX div 2,GetMaxY div 2, 50);


-, , , , . QBasic . , , C0L0R:

C0L0R cf,cb

12 13 C0L0R cf, . [0,15], cf . 9 (EGA), . 12 13 . .

12, 1 100x75 , 0 15.

8_04.bas

REM

SCREEN 12

CLS

F0R Y=10 T0 310 STEP 100

F0R X=10 T0 460 STEP 150

LINE (X-l,Y-l)-(X+101,Y+76),15,

LINE (X,Y)-(X+100,Y+75),C0L,BF

C0L=C0L+1

SLEEP 1 : ' 1 NEXT X NEXT Y END

BGI- () setcoior(cf) setbkcolor (cb). Turbo Turbo Pascal . , setcoior. , , BGI- (. 8.1).

8.1. BGI-



Turbo

Turbo Pascal

0


BLACK

Black

1


BLUE

Blue

2


GREEN

Green

3


CYAN

Cyan

4


RED

Red

5


MAGENTA

Magenta

6


BR0WN

Brown

7

-

LIGHTGRAY

LightGray

8

-

DARKGRAY

DarkGray

9

-

LIGHTBLUE

LightBlue

10

-

LIGHTGREEN

LightGreen

11

-

LIGHTCYAN

LightCyan




Turbo

Turbo Pascal

12

-

LIGHTRED

LightRed

13

-

LIGHTMAGENTA

LightMagenta

14


YELL0W

Yellow

15


WHITE

White

"" "", . , . 8_04.bas :

8_04.

/* */

#include <stdio.h>

#include <conio.h>

#include <graphics.h>

main () {

int X,y,col=0;

int gd=0,gm;

initgraph(&gd,&gm, "");

for(y=10; y<=310; y+=100)

for(x=10; x<=460; x+=150) {

setfillstyle(1,col); /* col */

bar3d(x-l,y-l,x+101,y+76,0,l);

col++;

sleep(l); /* 1 */ }

getch () ; closegraph(); }

, . QBasic PALETTE PALETTE USING:

PALETTE reg,col PALETTE USING A%

reg , col [0,63] . %. - 1 (0xFF), .

setpaiette setallpaiette BGI :

SetPalette(reg,col);

SetAllPalette(A);


() , ( 23 ). , . ( ) .

QBasic PSET PRESET:

PSET , [,c] . PRESET x,y [,]

, , . , PSET , PRESET . , , . , . QBasic P0INT:

c=P0INT(x,y)

BGI:

: putpixel(,,);

: PutPixei(x,,);

c=getpixel (, ) ;

c:=-GetPixel (x, ) ;

, . , . , . , 64 . 640x480x4/8 = 153 600 . .

QBasic GET PUT:

GET (xl,yl)-(x2,y2), % PUT (,), %, ovr

, , (xl.yl) (2,2) , . , , %, . % , % . , , , .

, , PUT , . ovr . 0 :

BGI- getimage

putimage:

getimage(x1, y1,x2,y2,A);

putimage(x3,x4,A,ovr);

ovr:

: C0PY_PUT TP: CopyPut QBasic: PSET N0T_PUT NotPut PRESET

AND_PUT AndPut AND

0R_PUT 0rPut 0R

X0R_PUT XorPut X0R

BGI- , getimage:

size=imagesize(xl,yl,x2,y2);

, .


QBasic LINE , . , :

LINE (x1,y1l)-(2,2)[,[col][,mask] :' 0

LINE (x1,y1)-(x2,y2)[,[col] [,mask] :'

LINE (x1l,y1)-(x2,y2)[,[col] BF :'

LINE . (WIND0W), .

STEP, . (LINE - (2,2) ...), .

col , , C0L0R.

, mask . , 16 , , , . . . mask 16- , , . , , 8 , mask = &HFF00.

BGI- , :

(moveto, moverel) , . . , QBasic . , . (,) PRESET:

PRESET (x,y) PRESET STEP(dx,dy)

, (,) , , PRESET . (,), , PSET

PRESET:

col=P0INT(x,y) : PSET (x,y),col


PSET (, ), P0INT (, )

. (2,y2).

BGI- 16- . setiinestyle, , :

setlinestyle(style,mask,t);

, . style [0,4], :

: S0LID_LINE TP: SolidLn 0

D0TTED__LINE DottedLn 1

CENTER_LINE CenterLn 2 -

DASHED_LINE DashedLn 3

USERBIT_LINE userBitLn 4

, style = 4 mask, .

t 1 3, . " N0RM_WIDTH THICK_WIDTH, NormWidth ThickWidth.

BGI- , QBasic. 0 , :

drawpoly(k,xy);

k , x1, y1, 2, 2, ... . , , , , . .

Borland . , , BGI- . :

setcolor(0);

setbkcolor(15);

line{0,0,100,100);

. "" . QBasic . :

8_05.bas

SCREEN 12

VIEW (0,0)-(100,100) ,15

LINE (0,0)-(100,100) ,0

END

"" . , . .

8_05.pas

program black_white;

{ }

uses graph;

var

gd,gm,x,:integer; begin

gd:=0;

initgraph(gd,gm,'');

setcolor(0);

setbkcolor(15);

line(0,0,100,100);

{ , . . }

readln;

setpalette(l,0);

setcolor(1);

setbkcolor(15);

line(0,0,100,100); { }

readln;

closegraph; end.

X0R_PUT. BGI- CPY_PUT X0R_PUT setwritemode:

setwritemode(C0PY_PUT);

setwritemode(X0R_PUT);

, 2.

.

,

QBasic , ,

CIRCLE:

CIRCLE (x,y),R [,c] : '

CIRCLE (x,),R,[],al,a2 : '

CIRCLE (x,y),R,[],-al,-a2 : '

CIRCLE (x,y),R,[],,,k : '

CIRCLE (x,y),R,[],al,a2,k : '

CIRCLE (x,y),R,[],-al,-a2,k : '

, (CIRCLE STEP(,)...) . R , R k ( ) b ( ). k<la = RHb = k*R, k > 1 = k * R

b = R. :

8_06.bas

REM SCREEN 12

VIEW (0,0)-(400,400),,1

F0R X=10 T0 390 STEP 10

F0R Y=10 T0 390 STEP 10

LINE (X,10)-(X,390),7: '

LINE (10,Y)-(390,Y),7: ' NEXT Y NEXT X

LINE (0,200)- (400,200),14 : ' ""

LINE (200,0)-(200,400),14 : ' ""

CIRCLE (200,200),120,15,,,4/3 : '

CIRCLE (200,200),120,14,,,3/4 : '

END

400 10 . . .

al 2, . [0,2]. . al -, , 2 -. , . , . . , - .

, , . . , . - , , 30 60 .

8_07.bas

R

SCREEN 12

VIEW (0,0)-(400,400)

LINE (0,200)-(400,200),7 :' "" .

LINE (200,0)-(200,400),7 :' ""

CIRCLE (200,200),120,4,,,.75 :'

CIRCLE (200,200),90,4,,,.75 :'

CIRCLE (200,200),120,15,.5236,1.0472,.75 :'

CIRCLE (200,200),90,14,-.5236,-1.0472,.75 :'

END

CIRCLE , , C0L0R.

BGI- :

arc(x,,a1,a2,r); //

circle(,,r); //

ellipse(,,al,a2,r,r); //

QBasic - al .2 , , . .


, , . (, paint, fill). , , , , 8x8 (, ) 8x8xk (QBasic, 1 < k < 8). , , . , , QBasic BGI-, .

- , Borland. 8x8, , . , . , , . 8 . , . , (, pattern) .

BGI- () setfillstyle setfillpattern: setfillstyle(numpat,col); setfiilpattern(pattern,col);

numpat [0,12] (. 8.2). 0 (numpat < 12) (numpat = 12), setfillpattern. col , , .

8.2. BGI-





0

EMPTY FILL

EmptyFiil


1

S0LIQ_FILL

SolidFill

col

2

LINE_FILL

Line Fill


3

LT3LASH FILL

LtSlashFill

45°

4 SLASH FILL SlashFill 45°
5 BK£T.ASH "ILL EkSlashFill 135°
6 LTBKSLASH_?1LL LtBkSlashFill ; 135°

7

HATCH_FILL

HatchFill

, 0° 90°

8

XHATCH FILL

XHatchFill

, 45° 135°

9

INTERLEAVE FILL

InterleaveFill


10

WIDE_D0T_FILL

WideDotFill


11

CL0SE D0T FILL

CloseDotFill


12

USER_FILL

UserFill


, , .

8_08.

/* */

#include <stdio.h>

#include <conio.h>

#include <graphics.h>

main() {

int k,gd=0,gm;

int col=14; //

initgraph(sgd,&gm,"");

for(k=0; k<12;k++)

{

cleardevice();

printf("\n =%3",k);

setfillstyle(k,14);

bar(300,100,400,200);

getch();

} Closegraph(); }

numpat = 12, . pattern filipattern 8- :

: char patl[] = {0xCC,0x33,0,0x33,0,0x33, 0, 0x33};

setfillpattern(patl,4);

: const

patl:FillPatternType=($CC,$33,$,$33,$,$33,$, $33);

SetFillPattern(patl,4);

FillPatternType, Graph, 8 array [1. .8] of byte.

BGI- () :

. d "" , (d = 0.25 * (2 - x1)). , true false. true, ("") . , . .

bar3d, , . 0 (d = ) :

bar111,11,99,99);

rectangle(10,10,100,100);

, .

.

. , - . , , 28 [13]. 0 . , - . Builder C++, . , .

8_09.

/*

#include <stdio.h>

#include <conio.h>

#include <graphics.h>

#define Nmax 111

main()

{

int k,gd=0,gm;

unsigned char pattern[Nmax][8] ={

// 8x8

//====

// 0 =

{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},

// 1 =

{0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF},

//====

//=

// 2 = ( 1 , 7)

{0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00},

// 3 = (2:6)

{0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00},

// 4 = (3:5)

{0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00},

// 5 = (4:4)

{0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00, 0x00},

// = (5:3)

{0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00, 0x00},

// 7 = (6:2)

{0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00},

// 8 = (7:1)

{0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00},

// 9 = (1:1)

{0xFF,0x00,0xFF,0x00,0xFF,0x00,0xFF,0x00},

// 10.= (1:3)

{0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00},

// 11 = (3:1)

{0xFF, 0xFF,0xFF,0x00,0xFF,0xFF,0xFF,0x00},

// 12 = (2:2)

{0xFF,0xFF,0x00,0x00,0xFF,0xFF,0x00,0x00},

//= // 13 = (1:7)

{0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80},

// 14 = (1:3)

{0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88},

// 15 = (2:6)

{00,00, 00,00,00,00,00, 00.},

// 16 = (3:5)

{00,00,00,00,00,00,00,00},

// 17 = (4:4)

{0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0},

// 18 = (5:3)

{0xFS, 0xF8,0xF8,0xF8,0xF8,0xF8,0xF8,0xF8},

// 19 = (6:2)

{0xFC,0xFC,0xFC,0xFC,0xFC,0xFC, 0xFC, 0xFC},

// 20 = (7:1)

(0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE},

// 21 = (1:1)

{0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA},

// 22 = (3:1)

{0xEE, 0xEE, 0xEE,0xEE,0xEE,0xEE,0xEE,0xEE},

// 23 = (2:2)

{0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC},

//====

// 24 = (1:7,1:7)

{0xFF,0x80,0x80,0x80,0x80,0x80,0x80,0x80},

// 25 = (2:6,2:6)

{0xFF,0xFF,00,00,00,00,00, 00},

// 26 = (3:5,3:5)

{0xFF,0xFF,0xFF,00,00,00,00, 00},

// 27 = (4:4,4:4)

{0xFF,0xFF,0xFF,0xFF,0xF0,0xF0,0xF0, 0xF0},

// 28 = (5:3,5:3)

{0xFF,0xFF,0xFF,0xFF,0xFF,0xFS,0xFS,0xF8},

// 29 = (6:2,6:2)

{0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, 0xFC, 0xFC},

// 30 = (7:1,7:1)

{0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFE},

// 31 = (2:2,2:2)

{0xFF,0xFF,0x99,0x99,0xFF,0xFF,0x99, 0x99},

//=== // 32 = (1:10)

{0x01,0x02,0x04,0x08,0x10,0x20,0x40,0x80},

// 33 = (3:7)

{0x83,0x07,00,0xlC,0x38,0x70,00, 01},

// 34 = (6:3)

{0xC7,0x8F,0x1F,0,07,0xF8,0xFl, 0},

// 35 = (1:10)

{0x80,0x40,0x20,0x10,0x08,0x04,0x02,0x01},

// 36 = (3:7)

(01,00,0x70,0x38,0xlC,0x0E,0x07,0x83},

// 37 = (6:3)

{0,0xFl,0xF8,07,0,0xlF,0x8F, 0xC7},

//====

// 38 = (1:6,1:6)

{0x81,0x42,0x24,0x18,0x18,0x24,0x42,0x81},

//===

//=

// 39 = (4*1:4,4)

{0xF0,0x00,0x00,0x00,0x0F,0x00,0x00,0x00},

// 40 = (5*1:3,4)

{0xF8,0x00,0x00,0x00,0xlF,0x00,0x00,0x00},

// 41 = (4*2:4,4)

{0xF0,0xF0,0x00,0x00,0x0F,0x0F,0x00,0x00},

// 42 = (5*2:3,4)

{0xF8,0xF8,0x00,0x00,0xlF,0xlF,0x00,0x00},

// 43 = (4*1:4,7)

{0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00},

// 44 =

{0xFF,0x00,0x00,0x00,0xF0,0x00,0x00,0x00},

//= // 45 = (4*1:4,7)

{0x80,0x80,0x80,0x80,0x00,0x00,0x00,0x00},

// 46 = (4*1:4,4)

{0x80,0x80,0x80,0x80,0x08,0x08,0x08,0x08},

//==== //=

// 47 =

{0xF0,0x0F,0x00,0x00,0x00,0x00,0x00,0x00},

// 48 =

{0xF0,0xFF,0x0F,0x00,0x00,0x00,0x00,0x00},

// 49 =

(0x81,0x42,0x24,0x18,0x00,0x00,0x00,0x00},

// 50 =

{0x81,0,0x66,0,0x18,0x00,0x00,0x00},

//= // 51 =

{0x10,0x10,0x10,0xF0,0x01,0x01,0x01, 0x0F},

//==== // 52 = (1:1,1)

{0x00,0x55,0x00,0,0x00,0x55,0x00,0},

// 53 = (1:3,2)

{0x00,0x44,0x00,0x11,0x00,0x44,0x00,0x11},

// 54 =

{0x22,0x00,0x00,0x00,0x88,0x00,0x00,0x00},

// 55 =

{0x00,0,0x66,0x00,0x00,0x99,0x99,0x00},

// 56 =

{0x00,0x00,0x30,0x30,0x00,0x00,0x03,0x03},

// 57 =

{0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00},

// 58 =

{0x00,0x00,0,0,0,0,0x00,0x00},

// 59 =

{0,0x33,0,0x33,0,0x33,0,0x33},

// 60 =

{0,0x55,0,0x55,0,0x55,0, 0x55},

//====

// 61 =

{0x10,0x10,07,0x10,0x10,0x00,0x00,0x00},

// 62 =

(0x10,0x00,0x54,0x00,0x10,0x00,0x00,0x00},

// 63 =

{0x00,0x00,0x18,0,0,0x18,0x00,0x00},

// 64 =

{0x00,0x18,0,07,07,0,0x18,0x00},

// 65 =

{0x00,07,07,07,07,07,07, 0x00},

// 66 = 5x5

{0xF8,0xF8,0xF8,0xF8,0xF8,0x00, 0x00, 0x00}, // 67 = 6x6

{0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0x00, 0x00},

// 68 = 7x7

{0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0x00},

// 69 =

{0x00,07,0x42,0x42,0x42,0x42,07,0x00},

// 70 =

{0x00,0x00,0,0x24,0x24,0,0x00,0x00},

// 71 -

(0x00,07,0x42,05,05,0x42,07, 0x00},

// 72 = ""

(0x00,0x42,0x24,0x18,0x18,0x24,0x42, 0x00},

// 73 = ""

{0x00,0x44,0x28,0x10,0x10,0x10,0x00,0x00},

// 74 =

{0x00,0x42,0x24,0x18,0x00,0x00,0x00, 0x00},

// 75 =

{0x00,0x00,0x00,0x18,0x24,0x42,0x00,0x00},

// 76 =

{0x10,0x38,0x54,0x10,0x10,0x10, 0x00, 0x00}, // 77 =

{0x10,0x10,0x10,0x54,0x38,0x10,0x00,0x00},

// 78 =

{0x00,0x20,0x40,0xFC,0x40,0x20,0x00,0x00},

// 79 =

{0x00,0x10,0x08,0xFC,0x08,0x10,0x00, 0x00},

// 80 =

(0x00,0x08,0x18,0x3F,0x3F,0x18,0x08,0x00},

// 81 =

{0x20,0x70,08,0x22,0x22,08,0x07,0x02},

// 82 =

{0x24,0x02,0xlF,0x02,0x24,0x40,0xFS, 0x40},

// 83 =

{0x00,0x10,0x28,0x44,0x28,0x10,0x00,0x00},

// 84 =

{0x81,0x18,03,07,07,0,0x18,0x81},

// 85 =

{0x18,0,0,07,07,0,0,0x18},

// 86 = (d=6)

{0x00,0,0x42,0x42,0x42,0x42,0,0x00},

// 87 = (d=5)

{0x44,0x38,0x00,0x00,0x00,0x38,0x44,0x44},

// 88 =

(0x80,0x7F,0x41,0x41,0x41,0x41,0x41,0x7F},

// 89 =

{0x08,0x00,0x08,0x50,0x08,0x00,0x08, 0x00},

//====

// 90 =

{0x00,0x18,0,07,07,0,0x18,0x00},

// 91 =

{0xF0,0xF0,0xF0,0xF0,0x0F,0x0F,0x0F,0x0F),

// 92 =

{0,0x33,0,0x33,0,0x33,0,0x33},

// 93 =

{0x42,0,0,0x24,0x24,0,0,0x42},

//==== // 94 =

{0x00,0xFB,0xFB,0xFB,0x00,0xDF,0xDF,0xDF},

// 95 =

{0x00,0xFB,0x0A,0xFB,0x00,0xDF,0x50,0xDF},

// 96 =

{0,0,00,0,0,00,0,0},

// 97 =

(0x01,0x82,0x44,0x28,0x10,0x20,0x40,0x80},

// 98 = ,

{0x80,0x41,0x22,0x14,0x08,0x04,0x02,0x01},

// 99 =

{0x94,0x84,0x48,0x30,0x00,01,0x22,0x14},

// 100 =

{0xFF,0x01,0xVD,0x45,0x5D,0x41,0x7F,0x00},

// 101 = 1

{0x00,0,02,02,02,02,0,0x00},

// 102 = 2

{0x00,0x00,07,0x42,07,0x42,07,0x42},

// 103 = 3

{0x00,0x50,0,0x6D,0x7F,0x63,0x36,0xF0},

// 104 = 4

{0x92,0x24,0x49,0x92,0x24,0x49,0x92,0x24},

// 105 = 5

{01,0x22,0x14,0x14,0x22,0x91,0x48,0x24},

// 106 = 6

{0x02,0x91,0x68,0x08,0x10,0x16,0x89,0x40},

// 107 = 7

{0,0x42,05,07,07,05,0x42, 0},

// 108 = 8

{0x03,0x18,0x60,0x80,0x80,0x40,0x20,0x18},

// 109 = 9

{0xBF,0xA0,0xA0,0xBF,0xFB,0x0A,0x0A,0xFB},

// 110 = 10

{0xFF,0x81,0xBD,0xA5,0xA5,0xBD,0x81,0xFF},

// 111 = 11

{0xFF,0x81,0x81,0x99,0x99,0x81,0x81,0xFF}};

initgraph(&gd,&gm,""); f0r(k=0;k<Nmax;k++) {

cleardevice();

g0t0xy(1,1);

printf("\n =%d", k) ;

setfillpattern(&pattern[k] [0],4);

setfillstyle(12, 14);

bar3d(240,40,440,240,16,l);

getch (); } }

0 fi00dfiii: fl00dfill(x,,eg);

, (,). eg , . , (,). , eg. , - , . . 0 . .

QBasic LINE .. . BF.

. PAINT, . 0 PAINT :

PAINT (x,y),[c0l],eg PAINT (x,y),Ml$,cg PAINT (x,y),Ml$,cg,M2$

fi00dfill, c0l , C0L0R.

, M1$, 64 . 1$ . , , , . MI$ . . - , 8x16.

, . 0, - :

M1$=CHR$(&H0)+CHR$(&H0)+CHR$(&HF0)+CHR$(&HFF)

, - , , . , -.

:

M1$=M1$+CHR$(&H0)+CHR$(&H0)+CHR$(&H00)+CHR$(&HFF) M1$=M1$+CHR$(&H0)+CHR$(&H0)+CHR$(&H00)+CHR$(&HFF) M1$=M1$+CHR$(&H0)+CHR$(&H0)+CHR$(SH00)+CHR$(&HFF)

:

M1$=M1$+CHR$(&H0)+CHR$(&H0)+CHR$(&H0F)+CHR$(SHFF)

, , :

M1$=M1$+CHR$(&H0)+CHR$(&H0)+CHR$(&H00)+CHR$(&HFF) M1$=M1$+CHR$(&H0)+CHR$(&H0)+CHR$(&H00)+CHR$(&HFF) M1$=M1$+CHR$(&H0)+CHR$(&H0)+CHR$(&H00)+CHR$(&HFF)

0 , , .

8_10.bas

REM SCREEN 12

I1$=CHR$(&HFF):'

B0$=CHR$(&H0):'

G0$=CHR$(&H0):'

R0$=CHR$(&H0):'

R40$=CHR$(&HF0):' -

R04$=CHR$(&HF):' -

M1$=M1$+B0$+G0$+R40$+I1$: M1$=M1$+B0$+G0$+R0$+I1$ M1$=M1$+B0$+G0$+R0$+I1$ : M1$=M1$+B0$+G0$+R0$+I1$ M1$=M1$+B0$+G0$+R04$+I1$: M1$=M1$+B0$+G0$+R0$+I1$ M1$=M1$+B0$+G0$+R0$+I1$ : M1$=M1$+B0$+G0$+R0$+I1$

LINE (100,100)-(200,200),,B PAINT (150,150),M1$,15 END

:

8_11.bas

' SCREEN 12

I1$=CHR$(&HFF) '

B0$=CHR$(&H0) '

G0$=CHR$(&H0) '

R8$=CHR$(&HFF) '

RL$=CHR$(&H40) '

RR$=CHR$(£H2) '

M1$=M1$+B0$+G0$+R8$+I1$: M1$=M1$+B0$+G0$+RL$+I1$

M1$=M1$+B0$+G0$+RL$+I1$: M1$=M1$+B0$+G0$+RL$+I1$

M1$=M1$+B0$+G0$+R8$+I1$: M1$=M1$+B0$+G0$+RR$+I1$

M1$=M1$+B0$+G0$+RR$+I1$: Ml$=Ml$+B0$+G0$+RR$+Il$

LINE (100,100)-(200,200),,B

PAINT (150,150),M1$,15 END

""

, . "" , , . , , .

. ( 15, 0), , . 0 , , . "" 15 ( 1111). , , . . , . "" AND. X0R .

(0,0,300,300), fon, . (60,60) (240,240) 30 . "" , 100x100, . c1, ( ).

. , <Esc>.

8_12.

/* " "*/

#include <graphics.h>

#include <stdlib.h>

#include <alloc.h>

main () {

int gd=0,gm;

int cl,fon;

char q,

patl[] = {0x81,0x42,0x24,0x18,0x00,0x00,0x00, 0x00},

pat2[] = {0x7E,0xBD,0xDB,0xE7,0xFF,0xFF,0xFF, 0xFF};

int xyl[]={0,0,300,0,300,300,0,300} ;

long k;

char far *pl,*p2;

initgraph(Sgd,&gm,"") ;

k=imagesize(10,10,110,110) ;

pl=farmalloc(k); /* */

p2=farmalloc(k);

m:

fon=random(15)+1;

ml:

cl=random(15)+1;

if((cl==fon)) goto ml; /*3 */

setfillstyle(12,0);

setfillpattern(patl,cl);

bar(10,10,110,110);

getimage(10,10,110,110,pi); /*3 V

setfillstyle(12,0);

setfillpattern(pat2,15);

bar(10,10,110,110);

getimage(10,10,110,110,p2); /* */

setfillstyle(l,fon);

fillpoly(4,xyl);

setcolor (4);

circle(60,60,30) ; /* */

putimage(10,10,2,AND_PUT); /* "" */

putimage(10, 10,pl,X0R_PUT) ; /*3 */

setcolor (4);

circle(240,240,30);

setfillstyle(12,0);

setfillpattern(patl,cl);

bar(190,190,290,290); /*0 . Esc*/

q=getch();

if(q != 0xlb) goto m;

closegraph(); }


, , . 0 QBasic , ( ) . QBasic PRINT, .

BGI-, .

():

outtext(); outtextxy(x,,);

, . . outtextxy .

, (. 8.1).

. 8.1.

. , , , , . . settextjustify:

SetTextJustify(horiz,vert) ;

:

, - , , , , .

Borland- 11 , (DEFAULT_F0NT) , . , - 8x8 . - . , . , . , , , .

. (, SMALL_F0NT) , . (, SANS_SERIF_F0NT) , . . (, TRIPLEX_F0NT G0THIC_F0NT) " (. 8.2).

. 8.2. ,

, 3.1 7.0, ( , . .). 0 - , 866- . chr .

, , settextstyle:

SetTextStyle(font,dir,size);

font 0 10 (. 8.3).

8.3,





0

DEFAULT F0NT

DefaultFont

, 8x8

1

TRIPLEX_F0NT

TriplexFont


2

SMALL F0NT

SmallFont

0,

3

SANS_SERIF_F0NT

SansSerif Font

,

4

G0THIC F0NT

GothicFont

,

5

SCRIPT_F0NT


,

6

SIMPLEX F0NT


0

7

TRIPLEX SCR F0NT


,





8

C0MPLEX_F0NT


,

9

EUR0PEAN F0NT


0

10

B0LD_F0NT


,

dir 0 ( H0RIZ_DIR) 1 (VERT_DIR). , 90° . .

size, [1,10], , (size > 4) (size < 4) .

setusercharsize:

SetUserCharSize(mx,dx,my,dy);

(,) :

X=x*mx/dx; Y=y*my/dy;

, , , , . , .

textwidth textheight, , . outtextxy.

, . 8.2. . , ( = 470). SMALL_F0NT. "" (w = 180, h =270) SANS_SERIF_F0NT TRIPLEX_F0NT. , "" "", . . 0 , . 0 , . , 2.0 3.1 . . , .

DEFAULT_F0NT. setusercharsize (settextstyie). , , 1 ( 10 ).

8_13.

/* "" */

#include <stdio.h>

#include <conio.h>

#include <graphics.h>

int x,y=470;

void a_in_box(int dy) {

int w,h; /* 0 */

w=textwidth("");

h=textheight("");

printf("w=%d h=%d ",w,h);

/* 0 2 */

rectangle(x-2,y-h,x+w-2,y+2); /* */

outtextxy(x,y+dy,"A"); }

main()

{

int gd=0,gm;

initgraph(&gd,&gm,""); /* */

setpalette(l,0);

setcolor(1);

setbkcolor(15);

settextjustify(0,0);

settextstyle(2,0,l); /* SmallFont */

setusercharsize(30,1,267,1);

x=4;

a_in_box(0);

settextstyle(3,0,1); /* SansSerifFont */

setusercharsize(86,10,75,10);

x=186;

a_in_box(0);

settextstyle (1,0,1); /* TriplexFont */

setusercharsize(95,10,78,10);

x=368;

a_iri_box(0);

settextstyle(0,0,10); /* DefaultFont, =10 */

x=550;

a_in_box(10);

getch ();

closegraph(); }

,

8.14.

, . . . , .

1 ()

, (. ). , . " ". col 7 8 ( " " : bit=l- bit bit:=not bit). , .

2 (QBasic)

, .

3 (, )

bar3d .

8_14.bas

R DEFINT A-Z SCREEN 12

0=10: 0=10: col=8: w=50

F0R y=y0 T0 y0+7*w STEP w

col=15-col F0R x=x0 T0 x0+7*w STEP w

LINE (x,y)-(x+w,y+w),col,BF :'

LINE (x,y)-(x+w,y+w),15, :' 0 col=15-col:

' NEXT x NEXT

8_14.

/* */

#include <stdio.h>

#include <conio.h>

#include <graphics.h>

main() {

int x,y,x0=10,y0=10,col=8,w=50;

int gd=0,gm;

initgraph(Sgd,&gm,"");

for(y=y0; y<y0+8*w; y+=w)

{

col-15-col;

for(x=x0; x<x0+8*w; xt=w) {

setfillstyle(1,col);

bar3d(x,y,x+w,y+w,0,1); /* 0 */

col=15-col; /* */ } }

getch();

closegraph(); }

8_14.pas

program shach;

{ } uses Graph;

const

x0=10;

y0=10;

w=50;

col:integer=8;

var

i,j,gd, gm,x,:integer;

begin gd:=0;

initgraph(gd,gm,' ') ;

for i:=0 to 7 do begin

col:=15-col;

y:=y0+i*w;

for j:=0 to 7 do begin

x:=x0+j *w;

setfillstyle(1,col);

bar3d(x,y,x+w,y+w,0,true);

{ 0 }

col:=15-col;

{ }

end;

end;

readln;

closegraph;

end.

8.15. 0

( 8.3). () cifra, (,) k ( <= k <= 9) .

1 ()

(,) , . 0, 45 135 .

. 8.3.

0 6 ( ) ( ) , (0.0), , , . 8.4. () . , . b = 4*, . = = 2*. + b, () .

8.4.










  0 0 0 0
  -

0 1 2

b

0

0

b









3



-


4

-


-

-

5

-b

0

0

-b

. 8.4 , :

d1 = (0, ,b, ,-,-) d2 = (0,-, 0, , , 0)

.

. 1, 2 3 , 1, 2, 3 4 . , .

:

xl = 2 = 3=

yl = 2 = + = + 2*

:

xl=x 2=+ 3= 4 = +

yl = 2 = 3 = + 4= +

2 ()

- , , . , 0 . 0 1011111. 9 1111101 . . . :

8_15.

/* 7- */

#include <stdio.h>

#include <conio.h>

#include <graphics.h>

void cifra(int x,int y,int n) ;

void main() {

int gd=0,gm, k;

initgraph(&gd,&gm,"");

setcolor(4);

for(k=0;k<10;k++)

cifrat(k+1)*50,30,k) ; getch(}; return;

}

/*-----------------------------* /

void cifra(int x,int y,int n)

{

const a=4,b=20,c=a+a+b; //

const dl[]={a,b,a,-a,-b}; //

const d2 [] = {-a,_0,a,a, 0}; //

const dx[]={0,0,0,0,,0,}; // 1

const dy [] = {0, , 2*, 0, 0, , }; //

int j, k; struct {int x;int ;} [6]; //

char q[10][7]={ {1,0,1,1,1,1,1}, // 0

{0,0,0,0,1,0,1},{1,1,1,0,1,1,0}, // 1,2

{1,1,1,0,1,0,1},{0,1,0,1,1,0,1}, // 3,4

{1,1,1,1,0,0,1},{!,1,1,1,0,1,1}, // 5,6

{1,0,0,0,1,0,1},{1,1,1,1,1,1,1}, // 7,8

{1,1,1,1,1,0,1}}; // 9

for(j=0; j<7; j++) {

if(q[n][j]==0) continue;

xy[0].x=x+dx[j];

xy[0].y=y+dy[j];

for(k=l; k<6;k++)

{// if(j<3)

{//

xy[k].x=xy[k-l].x+dl[k-l];

xy[k].y=xy[k-l].y+d2[k-l]; }

else

{//

xy[k].x=xy[k-l].x-d2[k-l];

xy[k].y=xy[k-l].y+dl[k-l]; } }

fillpoly(6,(int *)xy); //

} }

8.16.

, , .

cifra . 0 "" , . , bar.

1 ()

gettime. , , . (hl.ml.sl) (h2,m2,s2) . , gettime , . , .

2 ()

, , , . . , . .

3 ()

cifra , ( ). .

4 ()

, .

8_16.pas

program time;

uses Crt, Dos, Graph;

var

gd,gm,k:integer;

hi,ml,si,h2,m2,s2,hs2:word;

procedure cifra(x,y,n:integer); type

a4=array [0..4] of integer;

a6=array [1..7] of byte; const

a=4; b=20; c=a+a+b;

dl:a4=(a,b,a,-a,-b);

d2:a4=(-a,0,a,a,0);

dx:a6=(0,0,0,0,c,0,c);

dy:a6=(0,c,2*c,0,0,c,c);

q:array[0..9]of byte=

($5F,$5,$76,$75,$2D,$79,$7B,$45,$7F,$7D); var

xy:array [0..5] of PointType;

j,k,d:byte; begin

setfillstyle(0,0);

bar(x-a,y-a,x+(c+a+a),y+2*(c+2*a));

d:=q[n];

for j:=1 to 7 do begin

if ((d) and ($80 shr j))=0 then continue;

[0]. :=x+dx[j];

[0].y:=y+dy[j];

for k:=l to 5 do if j<4 then begin

xy[k].x:=xy[k-l].x+dl[k-l];

xytk].y:=xy[k-l].y+d2[k-l];

end

else

begin

xy[k].x:=xy[k-l].x-d2[k-l];

xy[k].y:=xy[k-l].y+dl[k-l];

end;

setfillstyle(l,14);

fillpoly(6,xy);

end;

end;

begin gd:=0;

initgraph(gd,gm,'');

settextstyle(0,0,4);

setcolor(14);

outtextxy(136,44,':');

{ }

outtextxy(256,44,':');

{ }

setcolor(4);

hi:=100; { }

ml:=100;

sl:=100;

repeat

gettime(h2,m2,s2,hs2); ( 0 }

if hloh2 then begin { }

k:=h2 div 10;

cifra(50,30,k);

{ }

k:=h2 mod 10;

cifra(100,30,k); { }

hi:=h2; end;

if ml<>m2 then begin { }

k:=m2 div 10; cifra(170,30,k);

k:=m2 mod 10; cifra(220,30,k);

ml:=m2;

end;

if sl<>s2 then begin { }

k:=s2 div 10;

cifra(290,30,k);

k:=s2 mod 10; cifra(340,30,k);

sl:=s2; end;

unit1 KeyPressed;

closegraph;

end.

8.17.

( . Sprite ", ") , . . , . , , . , , .

0 , . , "" . , , X0R.

" " " ". "" 43x24 20 8 , ( ). "" , "" - (2 ). , .

1 ()

. ( QBasice GET, getimage). X0R .

2 ()

1000 , .

3 ()

0 , ( 0,6 ) (,), . (,) (dx.dy) - . , dx dy, . , .

4 (QBasic)

, SLEEP , S0UND f, dt. 0 f , dt ( 1 18,2 ). , , (, f = 32767 ).

8_17.bas

REM

DEFINT A-Z

DIM TARELKA(300)

=320: Y=240

SCREEN 12

CIRCLE (100,50),20,15,,,.4

PAINT (100,50),4,15

CIRCLE (100, 46); 20,15, 3.3,0, .3

LINE (107,44)-(110,38) ,15

CIRCLE (110,38),2,15

LINE (93,44)-(90,38),15

CIRCLE (90,38),2,15

'

GET (79,36)-(121,59),TARELKA

'

PUT (79,36),TARELKA,X0R

'

F0R I=0 T0 1000

PSET (INT(RND*639)+1,INT(RND*473)+1),INT(RND*15) +1

NEXT I

D0 WHILE INKEY$=""

PUT (X,Y),T, X0R :

S0UND 32767,4.92 ;' 0.6

PUT (A,Y),TAKELKA,X0R ;'

DX=INT(RND*60)+1: IF DX M0D 2=1 THEN DX=-DX

X=X+DX :'

IF X>590 THEN X=590 :'

IF X<0 THEN X=0 :'

DY=INT(RND*40)+1: IF DY M0D 2=1 THEN DY=-DY

Y=Y+DY :'

IF Y>450 THEN Y=450 :'

IF Y<0 THEN Y=0 :'

L00P

END

8_17.

/* */ #include <graphics.h> #include <stdlib.h>

main() {

int x=320, y=240, i, dx, dy, gd=0, gm;

char Tarelka[600];

initgraph(&gd,&gm,"");

randomize() ; /* */

setfillstyle( S0LID_FILL, 4);

fillellipse(100, 50, 20, 8) ;

ellipse(100, 46, 190, 357, 20, 6) ;

line(107, 44, 110, 38);

circle(110, '38, 2} ;

line(93, 44, 90, 38);

circle(90, 38, 2); /* */

getimage(79, 36, 121, 59, Tarelka);

putimage(79, 36, Tarelka, X0R_PUT); /* */

for ( i=0 ; i<1000; ++i )

putpixel(random(639), random(479), random(15)+1) ; while ( !kbhit() ) { /* */

putimage(x, , Tarelka, X0R_PUT);

/* */

delay(6000);

/* */

putimage(x, , Tarelka, X0R_PUT);

/* */

/* */

dx = random(60);

if (dx % 2 == 0 ) dx = - dx;

x = x + dx;

if (x > 590) x = 590;

else if (x < 0) x = 0; dy = random(40);

if (dy % 2 == 0 ) dy = - dy; = + dy;

if (y > 450) = 450;

else if (y < 0) = 0; }

getch(); }

8_17.pas

{ " " } program nlo; uses Crt,Graph; var

x, y, i, dx, dy, gd, gm: integer;

Tarelka:array [1..600] of byte; begin

x:=320;

y:=240;

gd:=0;

initgraph(gd,gm,'');

randomize; { }

setfillstyletSolidFill, 4);

fillellipse(100, 50, 20, 8) ;

ellipse(100, 46, 190, 357, 20, 6);

line(107, 44, 110, 38);

circle (110, 38, 2); line(93, 44, 90, 38); circle(90, 38, 2);

{ }

getimage(79, 36, 121, 59, Tarelka);

putimage(79, 36, Tarelka, X0Rput);

{ }

for i:=0 to 1000 do

putpixel(random(639), random(479), random(15}+1);

repeat { }

putimage(,,Tarelka,X0Rput);

{ }

delay(6000);

{ }

putimage(,,Tarelka,X0Rput);

{ }

( }

dx:=random(60);

if odd(dx) then dx:=- dx;

x:=x+dx;

if x>590 then x:=590;

if x<0 then x:=0;

dy:=random(40);

if odd(dy) then dy:=- dy;

y:=y+dy;

if y>450 then y:=450;

if y<0 then y:=0;

until KeyPressed;

closegraph;

end.

8_18.

, , . 23 , 28 , 33 . , , :

PH=SIN(2*PI*T/23)

IN=SIN(2*PI*T/28)

EM=SIN(2*PI*T/33)

, . 0 "" . 0 , "" , , , .

. , XX . 4.

1 ()

, :

2 ()

offset . , 365 . 365 1900 . days, . (days [1] = 29), .

3 ()

, DATE$ (QBasic), getdate (), GetDate ().

4 (QBasic)

. , , . , L0CATE -, . , .

5 ()

round, . , floor ceil .

6 ()

0 , Crt, Graph. , , gotoxy .

8_18.bas

DECLARE SUB AXIS()

DECLARE SUB GRAFIK(t!,dfi!,col!)

DECLARE FUNCTI0N 0FFSET!(d!,m!,!)

REM

DATA 30,28,31,30,31,30,31,31,30,31,30,31

DIM SHARED days(11),a

F0R k=0 T0 11: READ days(k): NEXT k

wwod:

PRINT " "

PRINT " , () "

INPUT d,m,

d$=DATE$: ml=VAL(LEFT$(d$,2)) : dl=VAL(MID$(d$, 4, 2))

yl=VAL(RIGHT$(d$, 4))

IF (m<l)0R(m>12)0R(d<l)0R(d>days(m))0R(y<1900)0R(y>yl) THEN

PRINT " . "

SLEEP 1: G0T0 wwod END IF

IF (y1 M0D 4)=0 THEN days(2)=29:'

a=days(ml):'

'

dd=0FFSET(l,ml,yl)-0FFSET(d,m,) SCREEN 12

PRINT " - "

PRINT " - "

PRINT " - "

'

axis

GRAFIK 23,dd

M0D 23,4

GRAFIK 28,dd

M0D 28,2

GRAFIK 33,dd

M0D 33,1

SLEEP END

SUB AXIS

LINE (0,140)-(0,340)

LINE (0,240)-(a*20,240)

F0R j=l T0 a stroke=5

IF (j M0D 5)=0 THEN stroke=10

LINE (j*20,240+stroke)-(j*20,240-stroke)

IF stroke=10 THEN L0CATE 17,(j*20-4)\8: PRINT j

NEXT j

END SUB

SUB GRAFIK(t,dfi, col)

C0NST twopi=6.2831853*

x=0: y=240-100*SIN(twopi*dfi/t): C0L0R col PSET (x,y)

F0R k=l T0 a xl=20*k

yl=240-100*SIN(twopi*(k+dfi)/t)

LINE -(xl,yl)

NEXT k

END SUB

FUNCTI0N 0FFSET (d,m,y)

REM 1.01.1900

d.m.y dd=365: ' 1900 REM

F0R k%=1901 T0 -1 dd=dd+365

REM

IF (k% M0D 4)=0 THEN dd=dd+l NEXT k%

REM m

F0R k%=l T0 m-1: dd=dd+days(k%): NEXT k%

0FFSET=dd+d:' , m

END FUNCTI0N

8_18.

#include <dos.h>

#include <math.h>

#include <stdio.h>

#include <graphics.h>

#include <conio.h>

#define twopi 2*M_PI

void axis(void);

void grafik(int t, int dfi, int color);

long offset(int d, int m,int y);

int round(double x);

char days[]={30,28,31,30,31,30,31,31,30,31,30,31}; int a ;

main () {

int gd=0,gm, k,d,m, y,ml,yl;

struct date q;

long dd; wwod:

clrscr () ;

gotoxy(1,1);

printf(" \n");

printf(" , () \n");

scanf("%d %d %d",&d,&m,&y);

getdate(&q);

ml=q.da_mon;

yl=q.da_year;

if(m<l || m>12 || d<l || d>days[m-l] || y<1900 || y>yl)

{

printf("\nB . Enter ");

getch();

goto wwod;

}

if(yl % 4 == 0) days[l]=29;

a=days[ml-1];

dd=offset(l,ml,yl)-offset(d,m,y);

initgraph(&gd, &gm, "");

gotoxy(1,1);

printf (" - ");

gotoxy(1,2);

printf (" - ");

gotoxy(l,3);

printf (" - ");

axis();

grafik(23,dd % 23,RED);

grafik(28,dd % 28,GREEN);

grafik(33,dd % 33,BLUE);

getch();

closegraph ();

}

/*---------------------------------*/

void axis(void)

{ /* */

int j,str; char qq[5];

line(0,140,0,340); /* */

line(0,240,a*20,240);

/* */

/* */

for(j=l;j <= a;j++) {

str=5;

if(j % 5 == 0) str=10;

line(j*20,240+str,j*20,240-str);

if (str == 10)

{ /* 5 */

itoa(j,qq,10);

outtextxy(j*20-5,240+20,qq);

}

}

} /*---------------------------*/

void grafik(int t,int dfi,int color)

/* */

/* t - ( ) */

/* dfi - =0 */

/* color - */

/***************************/

{

int x,y,x1,y1,k; =0;

y=round(240-100*sin(twopi*dfi/t));

setcolor(color); moveto(x,);

for(k=l; k<=a; k++)

{

xl=20*k;

yl=round(240-100*sin(twopi*(k+dfi)/t));

lineto(xl,yl); }

}

/*-------------------------------*/

long offset(int d,int m,int y)

{

/* 1.01.1900 d.m.y */ int k; long dd;

dd=365;

/* 1900 */

/* */

for(k=1901; k<y; k++)

{

dd += 365;

if(k % 4 == 0) dd++;

/* */

}

dd += d;

/* m */

for(k=0; k<m-l; k++)

dd += days[k];

/* , m */ return dd;

}

/*-----------------------------------*/

int round(double x)

{ /* */

if(x>=0) return (int)(x+0.5);

return (int)(x-0.5); }

8.18.pas

program bioritms; uses Graph,Dos; label wwod; const

twopi=2*Pi;

days:array [1..12] of byte = (30,28,31,30,31,30,31,31,30,31,30,31);

var

a, k, d,m, y,dl,ml,yl:word;

gd,gm:integer;

dd: longint;

procedure axis; var

j,stroke:integer; s:string[2];

begin

line(0,140,0,340);

line(0,240,a*20,240);

for j : =1 to a do begin

stroke:=5; str(j,s);

if j mod 5=0 then stroke:=10;

line(j *20,240+stroke,j*20,240-stroke);

if stroke=10 then outtextxy(j*20-5,240+20, s) ;

end;

end;

procedure grafik(t,dfi,color:integer) ;

var

x,y,x1,y1,k:integer;

begin

x:=0;

y:=round(240-100*sin(twopi*dfi/t));

setcolor(color); moveto(x,y) ;

for k:=l to a do begin

xl:=20*k;

yl:=round(240-100*sin(twopi*(k+dfi)/t));

lineto(xl,yl);

end;

end;

function offset(d,m,y:integer)rlongint;

{ 1.01.1900 d.m.y}

var

k:integer;

dd:longint;

begin

dd:=365; { 1900 } { }

for k:=1901 to y-1 do begin

dd:=dd+365;

{ }

if k mod 4=0 then inc(dd);

end;

{ m}

for k:=l to m-1 do inc(dd,days[k]);

sdwig:=dd+d; { , m}

end;

begin

gd:=0; wwod:

writeln(' ');

writeln(' , () ');

readln(d,m,);

GetDate(y1,m1,d1,k); { }

if (m<l)or(m>12)or(d<l)or(d>days[m])or(y<1900)or(y>yl) then begin

write(' . Enter ');

readln;

goto wwod;

end;

if yl mod 4=0 then days[2]:=29; { }

:=days[ml];

{ }

{ }

dd:=offset(I,ml,yl)-offset(d,m,);

initgraph(gd,gm,'');

outtextxy(0,0,' - ');

outtextxy(0,20,' - ');

outtextxy(0, 40,' - ');

axis;

{ }

grafik(23,dd mod 23,RED);

grafik(28,dd mod 28,GREEN);

grafik(33,dd mod 33,BLUE);

readln;

closegraph;

end.

      . - 3GL   - 4GL   5GL  

, - , . , , , .. , . . , " ".




 10.11.2021 - 12:37: - Personalias -> WHO IS WHO - - _.
10.11.2021 - 12:36: - Conscience -> . ? - _.
10.11.2021 - 12:36: , , - Upbringing, Inlightening, Education -> ... - _.
10.11.2021 - 12:35: - Ecology -> - _.
10.11.2021 - 12:34: , - War, Politics and Science -> - _.
10.11.2021 - 12:34: , - War, Politics and Science -> . - _.
10.11.2021 - 12:34: , , - Upbringing, Inlightening, Education -> , - _.
10.11.2021 - 09:18: - New Technologies -> , 5G- - _.
10.11.2021 - 09:18: - Ecology -> - _.
10.11.2021 - 09:16: - Ecology -> - _.
10.11.2021 - 09:15: , , - Upbringing, Inlightening, Education -> - _.
10.11.2021 - 09:13: , , - Upbringing, Inlightening, Education -> - _.
Bourabai Research -  XXI Bourabai Research Institution