Story Transcript
program braille(input,output); uses crt,graph; var grd,grm,errc,i,j,k,l,m,n,x,y,r,rell,cont,h:integer; pal:string[30]; enteros:string[10]; enteros2:string[12]; circulito:string; dec:char; {creacion de esferita base} procedure circ; begin circle(x,y,r); floodfill(x,y,rell); end; {creacion de letras y simbolos braille} procedure aa; begin circ; x:=x+4*r; end; procedure bb; begin circ; y:=y+4*r;
1
circ; x:=x+4*r end; procedure cc; begin circ; x:=x+4*r; circ; end; procedure dd; begin circ; x:=x+4*r; circ; y:=y+4*r; circ; end; procedure ee; begin circ; y:=y+4*r; x:=x+4*r; circ; end; procedure ff; begin
2
circ; y:=y+4*r; circ; y:=y−4*r; x:=x+4*r; circ; end; procedure gg; begin circ; y:=y+4*r; circ; x:=x+4*r; circ; y:=y−4*r; circ; end; procedure hh; begin circ; y:=y+4*r; circ; x:=x+4*r; circ; end; procedure ii;
3
begin y:=y+4*r; circ; y:=y−4*r; x:=x+4*r; circ; end; procedure jj; begin y:=y+4*r; circ; x:=x+4*r; circ; y:=y−4*r; circ; end; procedure kk; begin circ; y:=y+8*r; circ; x:=x+4*r end; procedure ll; begin circ;
4
y:=y+4*r; circ; y:=y+4*r; circ; x:=x+4*r; end; procedure mm; begin circ; y:=y+8*r; circ; y:=y−8*r; x:=x+4*r; circ; end; procedure nn; begin circ; x:=x+4*r; circ; y:=y+4*r; circ; x:=x−4*r; y:=y+4*r; circ; x:=x+4*r;
5
end; procedure enie; begin circ; y:=y+4*r; circ; y:=y−4*r; x:=x+4*r; circ; y:=y+4*r; circ; y:=y+4*r; circ; end; procedure oo; begin circ; y:=y+8*r; circ; y:=y−4*r; x:=x+4*r; circ; end; procedure pp; begin circ;
6
y:=y+4*r; circ; y:=y+4*r; circ; y:=y−8*r; x:=x+4*r; circ; end; procedure qq; begin circ; y:=y+4*r; circ; y:=y+4*r; circ; y:=y−8*r; x:=x+4*r; circ; y:=y+4*r; circ; end; procedure rr; begin circ; y:=y+4*r; circ;
7
y:=y+4*r; circ; y:=y−4*r; x:=x+4*r; circ; end; procedure ss; begin y:=y+4*r; circ; y:=y+4*r; circ; y:=y−8*r; x:=x+4*r; circ; end; procedure tt; begin y:=y+4*r; circ; y:=y+4*r; circ; y:=y−4*r; x:=x+4*r; circ; y:=y−4*r;
8
circ; end; procedure uu; begin circ; y:=y+8*r; circ; x:=x+4*r; circ end; procedure vv; begin circ; y:=y+4*r; circ; y:=y+4*r; circ; x:=x+4*r; circ; end; procedure ww; begin y:=y+4*r; circ; x:=x+4*r; y:=y−4*r;
9
circ; y:=y+4*r; circ; y:=y+4*r; circ; end; procedure xx; begin circ; x:=x+4*r; circ; y:=y+8*r; x:=x−4*r; circ; x:=x+4*r; circ; end; procedure yy; begin circ; x:=x+4*r; circ; y:=y+4*r; circ; y:=y+4*r; circ;
10
x:=x−4*r; circ; x:=x+4*r; end; procedure zz; begin circ; y:=y+8*r; circ; x:=x+4*r; circ; y:=y−4*r; circ; end; procedure aacent; begin circ; y:=y+4*r; circ; y:=y+4*r; circ; x:=x+4*r; circ; y:=y−4*r; circ; end;
11
procedure eacent; begin y:=y+4*r; circ; y:=y+4*r; circ; x:=x+4*r; circ; y:=y−8*r; circ; end; procedure iacent; begin y:=y+8*r; circ; y:=y−8*r; x:=x+4*r; circ; end; procedure oacent; begin y:=y+8*r; circ; x:=x+4*r; circ; y:=y−8*r;
12
circ; end; procedure uacent; begin y:=y+4*r; circ; y:=y+4*r; circ; x:=x+4*r; circ; y:=y−4*r; circ; y:=y−4*r; circ; end; procedure udoblepunto; begin circ; y:=y+4*r; circ; x:=x+4*r; circ; y:=y+4*r; circ; end; procedure may;
13
begin x:=x+4*r; circ; y:=y+8*r; circ; x:=x+6*r; y:=y−8*r; end; procedure num; begin x:=x+4*r; circ; y:=y+4*r; circ; y:=y+4*r; circ; x:=x−4*r; circ; x:=x+4*r; x:=x+6*r; y:=y−8*r; end; procedure coma; begin y:=y+4*r; circ;
14
x:=x+4*r; end; procedure ptocoma; begin y:=y+4*r; circ; y:=y+4*r; circ; x:=x+4*r; end; procedure dosptos; begin y:=y+4*r; circ; x:=x+4*r; circ; end; procedure pto; begin y:=y+8*r; circ; x:=x+4*r; end; procedure guion; begin y:=y+8*r;
15
circ; x:=x+4*r; circ; end; procedure exclam; begin y:=y+4*r; circ; y:=y+4*r; circ; y:=y−4*r; x:=x+4*r; circ; end; procedure interr; begin y:=y+4*r; circ; y:=y+4*r; x:=x+4*r; circ; end; procedure comill; begin y:=y+4*r; circ;
16
y:=y+4*r; circ; x:=x+4*r; circ; end; procedure par1; begin circ; y:=y+4*r; circ; y:=y+4*r; x:=x+4*r; circ; end; procedure par2; begin y:=y+8*r; circ; x:=x+4*r; y:=y−4*r; circ; y:=y−4*r; circ; end; procedure part; begin
17
y:=y+4*r; end; procedure esp; begin x:=x+4*r; end; {inicio} begin clrscr; {iniciacion de graph} begin grd:=detect; initgraph(grd,grm,'c:\tp\bgi'); errc:=graphresult; if errc=grok then writeln('ok') else writeln('error ',grapherrormsg(errc)) end; delay(1000); {presentaciones} cont:=0; r:=2; rell:=7; setcolor(7);
18
k:=0; {presentacion 2 laboratorios de desarrollo} begin setcolor(red); circle(100,175,69); setcolor(blue); circle(100,175,72); rectangle(5,150,30,200); rectangle(3,148,30,202); rectangle(170,150,getmaxx−5,200); rectangle(170,148,getmaxx−3,202); circle(100,175,75); setfillstyle(1,blue); floodfill(0,0,blue); floodfill(600,400,blue); floodfill(172,170,blue); floodfill(169,149,blue); floodfill(169,201,blue); floodfill(28,170,blue); setcolor(red); circle(100,175,55); setfillstyle(1,red); line(52,132,132,222); line(68,128,148,218); floodfill(100,175,red); line(70,224,150,134);
19
line(54,220,134,130); floodfill(130,145,red); floodfill(70,205,red); floodfill(100,235,red); setfillstyle(1,yellow); floodfill(6,151,blue); floodfill(600,151,blue); setcolor(2); setfillstyle(1,15); settextstyle(10,0,7); outtextxy(210,95,'X−LABS'); floodfill(280,170,2); floodfill(230,170,2); floodfill(345,170,2); floodfill(415,170,2); floodfill(475,170,2); floodfill(540,170,2); setcolor(0); outtextxy(210,95,'X−LABS'); setcolor(7); settextstyle(7,0,4); outtextxy(192,225,'S O F T W A R E'); setcolor(7); settextstyle(2,0,5); outtextxy(50,430,' Laboratorios X Trencito−Valdivia−Chile'); settextstyle(6,0,3);
20
setcolor(0); outtextxy(20,20,'developed by'); delay(3000); end; {presentacion 4 braille system} begin cleardevice; setcolor(3); setbkcolor(0); settextstyle(1,0,2); outtextxy(50,100,'microhard presents : '); settextstyle(2,0,0); outtextxy(154,100,'tm'); settextstyle(10,0,8); setcolor(red); outtextxy(70,120,'BR0ILER'); settextstyle(7,0,3); cont:=1; for cont:= 0 to 10 do {repeat} begin setcolor((random(getmaxcolor))+2); outtextxy(310,255,'r e "v i s i o n" 3 . 5'); setcolor(white); outtextxy(150,300,'traductor espa¤ol − braille'); outtextxy(400,450,'now loading . . .');
21
delay(300); setcolor(0); outtextxy(400,450,'now loading . . .'); {cont:=cont+1;} delay(300); end; {until cont=5;} end; repeat begin if (dec=('i')) or (dec=('I')) then begin dec:=('0'); cleardevice; setcolor(white); settextstyle(0,0,0); begin outtextxy(180,10,'I N T R U C C I O N E S '); outtextxy(40,50, 'El siguiente programa fue dise¤ado para convertir palabras y '); outtextxy(40,70, 'expresiones en espa¤ol a codigo BRAILLE. '); outtextxy(40,90, 'El maximo de caracteres posibles de ingresar es 30. '); outtextxy(40,110,'(Se incluye como caracteres letras, espacio, coma, puntos, etc.)'); outtextxy(40,130,'Si desea ingresar un n£mero debe usar "," si es un numero decimal'); outtextxy(40,150,'no entero (ejemplo: 3,5) y "/" si es una fracci¢n (ejemplo 4/2) '); outtextxy(40,170,'en caso que despues de "/" se ingrese una letra (ej:5/a),el programa'); outtextxy(40,190,'omitira el "/" y lo tomara como 5 a, notese que 5/11 es distinto');
22
outtextxy(40,210,'de 5/1a, en este caso el programa lo tomara como 5/1 a '); outtextxy(40,250,'nota: no se consideraran como caracteres validos #,$,%,&,ø,|,@, etc'); outtextxy(40,270,'en este caso se le asignara un espacio.'); setcolor(red); outtextxy(300,400,'Presione cualquier tecla para continuar'); { while not keypressed do} dec:=readkey; { if (dec_2) <> (char(13)) then esp; while (dec_2=char(13)) do } end; end; {pantalla principal} settextstyle(1,0,3); cleardevice; x:=10; y:=190; i:=0; rell:=15; begin setcolor(7); setfillstyle(1,rell); outtextxy(230,10,'ingrese su frase'); settextstyle(0,0,0); setcolor(3); outtextxy(240,60,'maximo 30 caracteres'); settextstyle(1,0,3);
23
{lectura de datos (letras)} setcolor(rell); k:=0; rell:=1; repeat i:=i+1; pal[i]:=readkey; if pal[i]<>char(13) then outtextxy(39*rell,90+k*35,pal[i]); delay(100); rell:=rell+1; if (rell*40>600) then begin k:=k+1; rell:=1; end; until (pal[i]=char(13)) or (i=30) end; rell:=15; k:=0; enteros:=('12345678900'); enteros2:=('1234567890,/,'); {radio de la esferita} r:=3; k:=0; {traduccion a braille}
24
for j:=1 to i do begin if x>=610 then begin y:=190+(k+1)*100; x:=10; k:=k+1; end; l:=0; {buscador de fracciones} repeat l:=l+1; until (pal[l]=('/')) or (l=i); if l<>i then; {{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{} if pal[j]=('a') then aa; if pal[j]=('b') then bb; if pal[j]=('c') then cc; if pal[j]=('d') then dd; if pal[j]=('e') then ee; if pal[j]=('f') then ff; if pal[j]=('g') then gg; if pal[j]=('h') then hh; if pal[j]=('i') then ii; if pal[j]=('j') then jj; if pal[j]=('k') then kk;
25
if pal[j]=('l') then ll; if pal[j]=('m') then mm; if pal[j]=('n') then nn; if pal[j]=('¤') then enie; if pal[j]=('o') then oo; if pal[j]=('p') then pp; if pal[j]=('q') then qq; if pal[j]=('r') then rr; if pal[j]=('s') then ss; if pal[j]=('t') then tt; if pal[j]=('u') then uu; if pal[j]=('v') then vv; if pal[j]=('w') then ww; if pal[j]=('x') then xx; if pal[j]=('y') then yy; if pal[j]=('z') then zz; if pal[j]=(' ') then aacent; if pal[j]=(' ') then eacent; if pal[j]=('¡') then iacent; if pal[j]=('¢') then oacent; if pal[j]=('£') then uacent; if pal[j]=('£') then udoblepunto; if pal[j]=(',') then coma; if pal[j]=('.') then pto; if pal[j]=(';') then ptocoma; if pal[j]=(':') then dosptos;
26
if pal[j]=('−') then guion; if (pal[j]=('-')) or (pal[j]=('!')) then exclam; if (pal[j]=('¨')) or (pal[j]=('?')) then interr; if pal[j]=('"') then comill; if pal[j]=('(') then par1; if pal[j]=(')') then par2; if pal[j]=('/') then part; if (pal[j]=(' ')) or (pal[j]=('#')) or (pal[j]=('$')) or (pal[j]=('%')) or (pal[j]=('&')) then esp; if (pal[j]=('@')) or (pal[j]=('_')) or (pal[j]=('*')) or (pal[j]=('[')) or (pal[j]=(']')) then esp; if (pal[j]=('+')) or (pal[j]=('<')) or (pal[j]=('>')) or (pal[j]=('=')) or (pal[j]=('|')) then esp; if (pal[j]=('ø')) or (pal[j]=('ª')) or (pal[j]=('~')) then esp; if pal[j]=('A') then begin may; aa; end; if pal[j]=('B') then begin may; bb; end; if pal[j]=('C') then begin may; cc; end;
27
if pal[j]=('D') then begin may; dd; end; if pal[j]=('E') then begin may; ee; end; if pal[j]=('F') then begin may; ff; end; if pal[j]=('G') then begin may; gg; end; if pal[j]=('H') then begin may; hh; end; if pal[j]=('I') then
28
begin may; ii; end; if pal[j]=('J') then begin may; jj; end; if pal[j]=('K') then begin may; kk; end; if pal[j]=('L') then begin may; ll; end; if pal[j]=('M') then begin may; mm; end; if pal[j]=('N') then begin
29
may; nn; end; if pal[j]=('¥') then begin may; enie; end; if pal[j]=('O') then begin may; oo; end; if pal[j]=('P') then begin may; pp; end; if pal[j]=('Q') then begin may; qq; end; if pal[j]=('R') then begin may;
30
rr; end; if pal[j]=('S') then begin may; ss; end; if pal[j]=('T') then begin may; tt; end; if pal[j]=('U') then begin may; uu; end; if pal[j]=('V') then begin may; vv; end; if pal[j]=('W') then begin may; ww;
31
end; if pal[j]=('X') then begin may; xx; end; if pal[j]=('Y') then begin may; yy; end; if pal[j]=('Z') then begin may; zz; end; {fila de numeros} m:=0; repeat m:=m+1; until (m=11) or (pal[j]=enteros[m]); if (m<>11) then begin m:=0; n:=j; repeat
32
n:=n+1; m:=0; repeat m:=m+1; until (m=13) or (pal[n]=enteros2[m]); until (m=13); end; {{{{{{{{{{{{{} m:=0; repeat m:=m+1; until (m=11) or (pal[j]=enteros[m]) ; h:=0; repeat h:=h+1; until (h=11) or (pal[l+1]=enteros[h]) ; if m<>11 then begin num; for j:=j to n−1 do begin if (l<>i) and (h<>11) and (j
33
if pal[j]=('2') then begin bb; end; if pal[j]=('3') then begin cc; end; if pal[j]=('4') then begin dd; end; if pal[j]=('5') then begin ee; end; if pal[j]=('6') then begin ff; end; if pal[j]=('7') then begin gg; end; if pal[j]=('8') then begin
34
hh; end; if pal[j]=('9') then begin ii; end; if pal[j]=('0') then begin jj; end; if pal[j]=(',') then coma; if j<>n−1 then begin if x<626 then begin y:=190+k*100; x:=x+6*r; end; if x>=626 then begin y:=190+(k+1)*100; x:=10; ; end; end; if j=n−1 then x:=x+6*r;
35
end; end; if x<626 then begin y:=190+k*100; x:=x+6*r; end else if x>=610 then begin y:=190+(k+1)*100; x:=10; k:=k+1; end; end; {instruccion continuar o no} dec:='e'; repeat outtextxy(10,450,'desea seguir ingresando? (s/n) instrucciones?(i)'); dec:=readkey ; until (dec=('s')) or (dec=('S')) or (dec=('N')) or (dec=('n')) or (dec=('i')) or (dec=('I')) {instruccion para salir} end; until (dec=('n')) or (dec=('N')); {pantalla de despedida} cleardevice; setcolor(7);
36
outtextxy(170,200,'gracias por su preferencia'); setcolor(red); settextstyle(2,0,4); outtextxy(330,390,'a d v e r t e n c i a :'); settextstyle(0,0,0); setcolor(15); outtextxy(300,430,'cualquier reproduccion parcial o total'); outtextxy(300,450,' es un asqueroso plagio '); delay(5000); cleardevice; settextstyle(3,0,3); outtextxy(250,20,'DESARROLLO'); outtextxy(225,90,'PROGRAMADORES:'); outtextxy(135,140,'Cristian T Andres Nitrigual Perez'); outtextxy(115,230,'Andres Z Fernando Vargas Alvarado'); outtextxy(135,320,'Denis X Hardy Pacheco Bollmann'); outtextxy(225,430,'T H E E N D'); delay(6000); cleardevice; closegraph; end. {fin}
37