{ RADIAN.PAS Copyright (c) Jardo } { Program na prevod uhlov zo stup˛ov na radißny a naopak. } { ZaujÝmavÚ je grafickÚ spracovanie pomocou systÚmovej jednotky crt.} { } { Datum:10.08.2008 http://www.trsek.com } program radian; uses crt; var a,x:real;b:real; y,z:char; procedure nadpis; begin textbackground(blue); textcolor(white); clrscr; writeln; writeln(' RADIAN 1.0'); writeln; writeln('Program na prevod uhlov.'); writeln; end; procedure okno_prevod; begin nadpis; window(21,12,61,16); {tien okna} textbackground(0); clrscr; window(19,11,59,15); textbackground(7); clrscr; writeln(' ╔══════════════ Prevod ═══════════════╗'); writeln(' ║ ║'); writeln(' ║ ║'); writeln(' ║ ║'); write(' ╚═════════════════════════════════════╝'); end; procedure okno_zadanie; begin window(11,9,71,15); {tien} textbackground(0); clrscr; window(9,8,69,14); textbackground(7); clrscr; end; begin repeat {2} REPEAT {1} { aby mohol stlacit len pismena R,S,r,s } b:=0; okno_prevod; window(1,1,80,25); gotoxy(22,13); textbackground(7); textcolor(red); write(' R'); textcolor(black); write('adi ny-stupne '); textbackground(7);write(' │ ');textbackground(7); textcolor(red); write(' S'); textcolor(black); write('tupne-radi ny '); repeat until keypressed;y:=readkey; if y='R' then y:='r'; if y='S' then y:='s'; IF y='r' THEN b:=1; IF y='s' THEN b:=1; UNTIL b=1;{1} if y='r' then begin okno_prevod; window(1,1,80,25); gotoxy(22,13); textbackground(green); textcolor(red); write(' R'); textcolor(black); write('adi ny-stupne '); textbackground(7);write(' │ ');textbackground(7); textcolor(red); write(' S'); textcolor(black); write('tupne-radi ny '); delay(300); {-----koniec vyberu------} nadpis; okno_zadanie; textcolor(white); writeln(' ╔═════════════════ Prevod radi ny-stupne ═════════════════╗'); writeln(' ║ ║'); writeln(' ║ ║'); writeln(' ║ ║'); writeln(' ║ ║'); writeln(' ║ ║'); write(' ╚═════════════════════════════════════════════════════════╝'); window(1,1,80,25); gotoxy(12,10); textcolor(0); writeln('Uhol v radi noch:'); gotoxy(12,11); writeln('Uhol v stupňoch:'); gotoxy(12,12); writeln(' ─────────────────────────────────────────────────────'); textcolor(0); gotoxy(30,10); read(x); a:=(x*180)/3.14; gotoxy(29,11); write(a:3:3,'°'); end; { writeln('Prevod radi ny-stupňe:'); writeln; writeln; write(' Zadaj uhol v radi noch: '); readln(x); writeln; a:=(x*180)/3.14; write(' ',x:2:2,' rad = ',a:3:3,'°'); end;} if y='s' then begin okno_prevod; window(1,1,80,25); gotoxy(22,13); textbackground(7); textcolor(red); write(' R'); textcolor(black); write('adi ny-stupne '); textbackground(7);write(' │ ');textbackground(green); textcolor(red); write(' S'); textcolor(black); write('tupne-radi ny '); delay(300); {-----koniec vyberu------} nadpis; okno_zadanie; textcolor(white); writeln(' ╔═════════════════ Prevod stupne-radi ny ═════════════════╗'); writeln(' ║ ║'); writeln(' ║ ║'); writeln(' ║ ║'); writeln(' ║ ║'); writeln(' ║ ║'); write(' ╚═════════════════════════════════════════════════════════╝'); window(1,1,80,25); gotoxy(12,10); textcolor(0); writeln('Uhol v stupňoch:'); gotoxy(12,11); writeln('Uhol v radi noch:'); gotoxy(12,12); writeln(' ─────────────────────────────────────────────────────'); textcolor(0); gotoxy(29,10); read(a); x:=(a*3.14)/180; gotoxy(30,11); write(x:2:2,' rad'); end; { writeln('Prevod stupňe-radi ny:'); writeln; writeln; write(' Zadaj uhol v stupňoch: '); readln(a); writeln; x:=(a*3.14)/180; write(' ',a:3:3,'° = ',x:2:2,' rad'); end;} gotoxy(30,13); write(' opakovať? (a/n):'); repeat until keypressed;z:=readkey; if z='N' then z:='n'; until z='n'; {2} textbackground(blue); clrscr; window(21,10,61,16); {tien okna} textbackground(0); clrscr; window(19,9,59,15); textbackground(7); clrscr; writeln(' ╔═════════════════════════════════════╗'); writeln(' ║ RADIAN v1.0 ║'); writeln(' ║ ----------------------------------- ║'); writeln(' ║ ...just another school program ║'); writeln(' ║ (c) 2006 by Jardo ║'); writeln(' ║ (srobovak@azet.sk) ║'); write(' ╚═════════════════════════════════════╝'); end.