1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584 | { PROGRAMMED BY DINAMO }
{ CODING BEGINNED - SUNDAY 9 OF OCTOBER 2005, 12:35 HRS. }
{ http://mx.geocities.com/manuel_bach16/lenguajes/}
{É������������������������������»}{º Universidad de Colima º}
{º Facultad de Telematica º}
{Ì������������������������������¹}
{º Lenguajes Algoritmicos º}
{º º}{º AUTOR: ¸DINAMO º}
{º [Luis Manuel Juarez S.] º}
{º [dinamo_lmjs@hotmail.com] º}
{� ������������������������������¼}
{ THIS PROGRAM WAS DOWNLOADED FOR MX.GEOCITIES.COM/MANUEL_BACH16/LENGUAJES }
{ THIS PROGRAM WAS CODED WITH TEACHING PURPOSES }
Uses Crt,Dos;
Var
sel,aux:Char; {Variables tipo caracter}
dis:String[9]; {Display de la calculadora}
lim,i,j,time,flag_fun:Byte; point,zero,kn,clean:Boolean; {Variables Booleanas para evitar erres.}
n1,n2,auxn1,auxn2,r:Real;
{ THIS PROGRAM WAS DOWNLOADED FOR MX.GEOCITIES.COM/MANUEL_BACH16/LENGUAJES }
{ THIS PROGRAM WAS CODED WITH TEACHING PURPOSES }
Procedure calculator;
Var
x,y:Byte;
Begin Textcolor(15); Textbackground(1); {Colorear el fondo y los numeros de la calculadora}
x:=25; y:=5;
Gotoxy(x, y ); Write(' É���������������������������������» '); {|}
Gotoxy(x,y+ 1); Write(' ºÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿º '); {||}
Gotoxy(x,y+ 2); Write(' º³ ³º '); {|||} Gotoxy(x,y+ 3); Write(' ºÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙº '); {||||}
Gotoxy(x,y+ 4); Write(' Ì�������������������������Ë�������¹ '); {|||||}
Gotoxy(x,y+ 5); Write(' º ÚÄÄÄ¿ ÚÄÄÄ¿ ÚÄÄÄ¿ ÚÄÄÄ¿ º ÚÄÄÄ¿ º '); {||||||}
Gotoxy(x,y+ 6); Write(' º ³ 7 ³ ³ 8 ³ ³ 9 ³ ³ / ³ º ³ C ³ º '); {|||||||}
Gotoxy(x,y+ 7); Write(' º ÀÄÄÄÙ ÀÄÄÄÙ ÀÄÄÄÙ ÀÄÄÄÙ º ÀÄÄÄÙ º '); {||||||||} Gotoxy(x,y+ 8); Write(' º ÚÄÄÄ¿ ÚÄÄÄ¿ ÚÄÄÄ¿ ÚÄÄÄ¿ º ÚÄÄÄ¿ º '); {||||||||| Dibujar una calculadora estatica}
Gotoxy(x,y+ 9); Write(' º ³ 4 ³ ³ 5 ³ ³ 6 ³ ³ * ³ º ³ D ³ º '); {||||||||| en la pantalla}
Gotoxy(x,y+10); Write(' º ÀÄÄÄÙ ÀÄÄÄÙ ÀÄÄÄÙ ÀÄÄÄÙ º ÀÄÄÄÙ º '); {||||||||}
Gotoxy(x,y+11); Write(' º ÚÄÄÄ¿ ÚÄÄÄ¿ ÚÄÄÄ¿ ÚÄÄÄ¿ º ÚÄÄÄ¿ º '); {|||||||}
Gotoxy(x,y+12); Write(' º ³ 1 ³ ³ 2 ³ ³ 3 ³ ³ - ³ º ³ û ³ º '); {||||||} Gotoxy(x,y+13); Write(' º ÀÄÄÄÙ ÀÄÄÄÙ ÀÄÄÄÙ ÀÄÄÄÙ º ÀÄÄÄÙ º '); {|||||}
Gotoxy(x,y+14); Write(' º ÚÄÄÄ¿ ÚÄÄÄ¿ ÚÄÄÄ¿ ÚÄÄÄ¿ º ÚÄÄÄ¿ º '); {||||}
Gotoxy(x,y+15); Write(' º ³ . ³ ³ 0 ³ ³ = ³ ³ + ³ º ³ ý ³ º '); {|||}
Gotoxy(x,y+16); Write(' º ÀÄÄÄÙ ÀÄÄÄÙ ÀÄÄÄÙ ÀÄÄÄÙ º ÀÄÄÄÙ º '); {||}
Gotoxy(x,y+17); Write(' � �������������������������� �������¼ '); {|} End;
{ THIS PROGRAM WAS DOWNLOADED FOR MX.GEOCITIES.COM/MANUEL_BACH16/LENGUAJES }
{ THIS PROGRAM WAS CODED WITH TEACHING PURPOSES }
Procedure teclas;
Var
wait:Byte;
Begin
Textcolor(3); wait:=40; Case sel of
{Botones Fila Uno}
#55: Begin Gotoxy(30,11); Write('7'); Delay(wait); Textcolor(15); Gotoxy(30,11); Write('7'); End; {|}
#56: Begin Gotoxy(36,11); Write('8'); Delay(wait); Textcolor(15); Gotoxy(36,11); Write('8'); End; {|| Efecto}
#57: Begin Gotoxy(42,11); Write('9'); Delay(wait); Textcolor(15); Gotoxy(42,11); Write('9'); End; {|| de Presion} #47: Begin Gotoxy(48,11); Write('/'); Delay(wait); Textcolor(15); Gotoxy(48,11); Write('/'); End; {|| de Teclas}
#67: Begin Gotoxy(56,11); Write('C'); Delay(wait); Textcolor(15); Gotoxy(56,11); Write('C'); End; {|| 7 a C}
{Botones Fila Uno}
{Botones Fila Dos} #52: Begin Gotoxy(30,14); Write('4'); Delay(wait); Textcolor(15); Gotoxy(30,14); Write('4'); End; {|}
#53: Begin Gotoxy(36,14); Write('5'); Delay(wait); Textcolor(15); Gotoxy(36,14); Write('5'); End; {|| Efecto}
#54: Begin Gotoxy(42,14); Write('6'); Delay(wait); Textcolor(15); Gotoxy(42,14); Write('6'); End; {|| de Presion}
#42: Begin Gotoxy(48,14); Write('*'); Delay(wait); Textcolor(15); Gotoxy(48,14); Write('*'); End; {|| de Teclas}
#08: Begin Gotoxy(56,14); Write('D'); Delay(wait); Textcolor(15); Gotoxy(56,14); Write('D'); End; {|| 4 a D} {Botones Fila Dos}
{Botones Fila Tres}
#49: Begin Gotoxy(30,17); Write('1'); Delay(wait); Textcolor(15); Gotoxy(30,17); Write('1'); End; {|}
#50: Begin Gotoxy(36,17); Write('2'); Delay(wait); Textcolor(15); Gotoxy(36,17); Write('2'); End; {|| Efecto} #51: Begin Gotoxy(42,17); Write('3'); Delay(wait); Textcolor(15); Gotoxy(42,17); Write('3'); End; {|| de Presion}
#45: Begin Gotoxy(48,17); Write('-'); Delay(wait); Textcolor(15); Gotoxy(48,17); Write('-'); End; {|| de Teclas}
#83: Begin Gotoxy(56,17); Write('û'); Delay(wait); Textcolor(15); Gotoxy(56,17); Write('û'); End; {|| 1 a û}
{Botones Fila Tres}
{Botones Fila Cuatro}
#46: Begin Gotoxy(30,20); Write('.'); Delay(wait); Textcolor(15); Gotoxy(30,20); Write('.'); End; {|}
#48: Begin Gotoxy(36,20); Write('0'); Delay(wait); Textcolor(15); Gotoxy(36,20); Write('0'); End; {|| Efecto}
#13: Begin Gotoxy(42,20); Write('='); Delay(wait); Textcolor(15); Gotoxy(42,20); Write('='); End; {|| de Presion}
#43: Begin Gotoxy(48,20); Write('+'); Delay(wait); Textcolor(15); Gotoxy(48,20); Write('+'); End; {|| de Teclas} #32: Begin Gotoxy(56,20); Write('ý'); Delay(wait); Textcolor(15); Gotoxy(56,20); Write('ý'); End; {|| . a ý}
{Botones Fila Cuatro}
End;
End;
{ THIS PROGRAM WAS DOWNLOADED FOR MX.GEOCITIES.COM/MANUEL_BACH16/LENGUAJES }
{ THIS PROGRAM WAS CODED WITH TEACHING PURPOSES }
Procedure limpiar; {Procedimiento para limpiar Display}
Begin For i:=lim to 9 do
dis[i]:=' ';
Textcolor(1); Gotoxy(38,7); Write('ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ');
lim:=9;
point:=True; {Activar la colocacion del punto decimal} zero:=False; {Activar la alerta del Cero}
clean:=False; {Avtivar el limpiado del Display}
End;
{ THIS PROGRAM WAS DOWNLOADED FOR MX.GEOCITIES.COM/MANUEL_BACH16/LENGUAJES }{ THIS PROGRAM WAS CODED WITH TEACHING PURPOSES }
Procedure add; {Agregar caracteres}
Begin
If clean Then {Si clean es True, limpiar Display} limpiar;
If lim>0 Then {Si limite es mayor a 0, hacer}
Begin
If lim=9 Then {Condicion precaucion Cero}
zero:=False; For j:=lim to 9 do
Begin
aux:=dis[j]; {|}
dis[j-1]:=aux; {|| Codigo encargado de agregar los caracteres al Display}
dis[j]:=sel; {|} End;
lim:=lim-1; {Decrementar el limite de la cadena}
End
Else
Begin {Activar mensaje de Error} Textbackground(0);
Textcolor(4); Gotoxy(32,24); Write(char(7),'Haz llegado al Limite'); Delay(time);
Textcolor(0); Gotoxy(32,24); Write('Haz llegado al Limite');
End;
End;
{ THIS PROGRAM WAS DOWNLOADED FOR MX.GEOCITIES.COM/MANUEL_BACH16/LENGUAJES }
{ THIS PROGRAM WAS CODED WITH TEACHING PURPOSES }
Procedure cero; Begin
If clean Then {Si clean es True, Limpiar Display}
limpiar;
If lim>0 Then {Si limite es mayor a 0, hacer}
Begin If lim=9 Then {Codigo Precaucion CEro}
zero:=True;
If (lim=8) And zero Then
Begin {Mensaje de Alerta de Ceros}
Textbackground(0); Textcolor(4); Gotoxy(26,24); Write(char(7),'Colocar un caracter diferente de 0'); Delay(time);
Textcolor(0); Gotoxy(26,25); Write('Colocar un caracter diferente de 0');
End
Else {Si no hay problemas con el cero, hacer}
Begin For j:=lim to 9 do
Begin
aux:=dis[j]; {|}
dis[j-1]:=aux; {|| Codigo encargado de agregar los caracteres al Display}
dis[j]:=sel; {|} End;
lim:=lim-1; {Decrementar el limite de la cadena}
End;
End
Else Begin {Activar mensaje de Error}
Textbackground(0);
Textcolor(4); Gotoxy(32,24); Write(char(7),'Haz llegado al Limite'); Delay(time);
Textcolor(0); Gotoxy(32,24); Write('Haz llegado al Limite');
End; End;
{ THIS PROGRAM WAS DOWNLOADED FOR MX.GEOCITIES.COM/MANUEL_BACH16/LENGUAJES }
{ THIS PROGRAM WAS CODED WITH TEACHING PURPOSES }
Procedure punto; {Procedimiento para controlar los puntos decimales}
Begin
If clean Then {Si clean es True, limpiar display}
limpiar;
If lim>0 Then {Si limite es mayor a 0, hacer} Begin
If point Then {Si point(punto) es True, hacer}
Begin
If lim=9 Then {Si limite es 9, entonces agregar un 0 y punto [0.] en el Display}
Begin dis[9]:='0'; {| Codigo encargado de realizar}
lim:=lim-1; {| lo antes mensionado}
End;
For j:=lim to 9 do
Begin aux:=dis[j]; {|}
dis[j-1]:=aux; {| Codigo encargado de agregar los caracteres al Dislpay}
dis[j]:=sel; {|}
End;
lim:=lim-1; {Decrementar el limite de la cadena} point:=False; {Activar point, para decir que ya tenemos un punto}
End
Else {Si ya existe un punto, hacer}
Begin {Activar codigo de error}
Textbackground(0); Textcolor(4); Gotoxy(28,24); Write(char(7),'Solo puedes colocar un punto'); Delay(time);
Textcolor(0); Gotoxy(28,24); Write('Solo puedes colocar un punto');
End;
End
Else {Si el limite de la cadena es 0, hacer} Begin {Activar codigo de error}
Textbackground(0);
Textcolor(4); Gotoxy(32,24); Write(char(7),'Haz llegado al Limite'); Delay(time);
Textcolor(0); Gotoxy(32,24); Write('Haz llegado al Limite');
End; End;
{ THIS PROGRAM WAS DOWNLOADED FOR MX.GEOCITIES.COM/MANUEL_BACH16/LENGUAJES }
{ THIS PROGRAM WAS CODED WITH TEACHING PURPOSES }
Procedure del; {Procedimiento para eliminar un caracter del Display}
Var
auxlim:Byte; {Variable auxliar del limite de la cadena}
Begin
If lim<9 Then {Si limite es menor a 9, hacer} Begin
If lim=0 Then {Si limite es igual a 0, hacer}
auxlim:=1 {Asignar a auxlim el valor de 1}
Else {Si limite no es igual a 0, hacer}
auxlim:=0; {Asiganr a auxlim el valor de 0} For j:=9 downto lim+auxlim do
dis[j]:=dis[j-1]; {Ciclo para el borrado de un caracter}
For j:=9 downto lim do
Begin
If dis[j]=#46 Then {Si existe un punto} Begin point:=False; Break; End {No activar la bandera point}
Else {Si no existe el punto}
point:=True; {Activar la bandera point}
End;
lim:=lim+1; {Incrementar el limite de la cadena, ya que borramos un caracter} End
Else {Si limite es igual a 9, hacer}
Begin {Activar codigo de alerta}
Textbackground(0);
Textcolor(4); Gotoxy(35,24); Write(char(7),'No hay caracteres'); Delay(time); Textcolor(0); Gotoxy(35,24); Write('No hay caracteres');
End;
End;
{ THIS PROGRAM WAS DOWNLOADED FOR MX.GEOCITIES.COM/MANUEL_BACH16/LENGUAJES }{ THIS PROGRAM WAS CODED WITH TEACHING PURPOSES }
Procedure convert; {Procedimiento para convertir la cadena a numero}
Var
ce,cd,c,limnew,aux,lol:Byte; {|| Variables auxiliares} inc:Longint; {|| utilizadas para la conversion}
divo:Real; {|| de la cadena a numeros}
Begin
limnew:=lim+1; {Variable limite nuevo asignarle el limite de la cadena mas 1}
auxn1:=0; auxn2:=0; {inicializar las variables para la convertios de enteros y decimales} For c:=9 downto lim do
Begin
If dis[c]=#46 Then {Si existe el punto decimal, hacer}
Begin
cd:=9-c; {|} ce:=9-(limnew+cd); {||}
lol:=1; {|| saber cuantos enteros y decimales hay}
break; {|}
End
Else {Si no existe el punto decimal} If c=lim Then
Begin
ce:=9-lim; {|}
cd:=0; {| Hacer el conteo de los enteros }
lol:=0; {|} End;
End;
{ THIS PROGRAM WAS DOWNLOADED FOR MX.GEOCITIES.COM/MANUEL_BACH16/LENGUAJES }
{ THIS PROGRAM WAS CODED WITH TEACHING PURPOSES }
{Obtener Enteros}
inc:=1;
For c:=9-(cd+lol) downto lim do {Enteros}
Begin Case dis[c] of
'0': Begin aux:=0; auxn1:=auxn1+(aux*inc) end; {|}
'1': Begin aux:=1; auxn1:=auxn1+(aux*inc) end; {||}
'2': Begin aux:=2; auxn1:=auxn1+(aux*inc) end; {|||}
'3': Begin aux:=3; auxn1:=auxn1+(aux*inc) end; {||||} '4': Begin aux:=4; auxn1:=auxn1+(aux*inc) end; {||||| Conocer el valor numerico}
'5': Begin aux:=5; auxn1:=auxn1+(aux*inc) end; {||||| de los enteros}
'6': Begin aux:=6; auxn1:=auxn1+(aux*inc) end; {||||}
'7': Begin aux:=7; auxn1:=auxn1+(aux*inc) end; {|||}
'8': Begin aux:=8; auxn1:=auxn1+(aux*inc) end; {||} '9': Begin aux:=9; auxn1:=auxn1+(aux*inc) end; {|}
End;
inc:=inc*10;
End;
{Obtener Enteros}
{Obtener Decimales}
inc:=10;
For c:=9-(cd-1) to 9 do {Enteros}
Begin divo:=1/inc;
Case dis[c] of
'0': Begin aux:=0; auxn2:=auxn2+(aux*divo) end; {|}
'1': Begin aux:=1; auxn2:=auxn2+(aux*divo) end; {||}
'2': Begin aux:=2; auxn2:=auxn2+(aux*divo) end; {|||} '3': Begin aux:=3; auxn2:=auxn2+(aux*divo) end; {||||}
'4': Begin aux:=4; auxn2:=auxn2+(aux*divo) end; {||||| Conocer el valor numerico}
'5': Begin aux:=5; auxn2:=auxn2+(aux*divo) end; {||||| de los decimales}
'6': Begin aux:=6; auxn2:=auxn2+(aux*divo) end; {||||}
'7': Begin aux:=7; auxn2:=auxn2+(aux*divo) end; {|||} '8': Begin aux:=8; auxn2:=auxn2+(aux*divo) end; {||}
'9': Begin aux:=9; auxn2:=auxn2+(aux*divo) end; {|}
End;
inc:=inc*10;
End; {Obtener Decimales}
End;
{ THIS PROGRAM WAS DOWNLOADED FOR MX.GEOCITIES.COM/MANUEL_BACH16/LENGUAJES }
{ THIS PROGRAM WAS CODED WITH TEACHING PURPOSES }
Procedure funciones; {Procedimiento de las funciones Aritmecas}
Var
pivofun:Byte;
Begin Case sel of
#43: Begin {Si el simbolo es [+], hacer}
If lim<9 Then
Begin
convert; If kn Then
Begin n1:=auxn1+auxn2; kn:=False; clean:=True; End
Else
Begin n2:=auxn1+auxn2; End;
If n2<>0 Then Begin
limpiar; r:=n1+n2;
n1:=r;
n2:=0;
End; End;
End;
#45: Begin {Si el simbolo es [-], hacer}
If lim<9 Then
Begin convert;
If kn Then
Begin n1:=auxn1+auxn2; kn:=False; clean:=True; End
Else
Begin n2:=auxn1+auxn2; End; If n2<>0 Then
Begin
limpiar; r:=n1+n2;
n1:=r;
n2:=0; End;
End;
End;
#47: Begin {Si el simbolo es [/], hacer}
If lim<9 Then Begin
convert;
If kn Then
Begin n1:=auxn1+auxn2; kn:=False; clean:=True; End
Else Begin n2:=auxn1+auxn2; End;
If n2<>0 Then
Begin
limpiar; r:=n1/n2;
n1:=r; n2:=0;
End;
End;
End;
#42: Begin {Si el simbolo es [*], hacer} If lim<9 Then
Begin
convert;
If kn Then
Begin n1:=auxn1+auxn2; kn:=False; clean:=True; End Else
Begin n2:=auxn1+auxn2; End;
If n2<>0 Then
Begin
limpiar; r:=n1*n2; n1:=r;
n2:=0;
End;
End;
End; #32: Begin {Si el simbolo es [ESPACIO], hacer}
If lim<9 Then
Begin
convert;
limpiar; n1:=auxn1+auxn2; kn:=False; clean:=True;
r:=sqr(n1);
n1:=r;
n2:=0;
End Else
Begin
limpiar;
r:=sqr(n1);
n1:=r; End;
End;
#83: Begin {Si el simbolo es [S], hacer}
If lim<9 Then
Begin convert;
limpiar;
n1:=auxn1+auxn2; kn:=False; clean:=True;
r:=sqrt(n1);
n1:=r; End
Else
Begin
limpiar;
r:=sqrt(n1); n1:=r;
End;
End;
{ THIS PROGRAM WAS DOWNLOADED FOR MX.GEOCITIES.COM/MANUEL_BACH16/LENGUAJES }{ THIS PROGRAM WAS CODED WITH TEACHING PURPOSES }
#13: Begin {Si el simbolo es [=], hacer}
If lim<9 Then
Begin Case flag_fun of {Conocer que funcion quedo pendiente}
1: Begin {Suma}
convert;
If kn Then
Begin n1:=auxn1+auxn2; kn:=False; clean:=True; End Else
Begin n2:=auxn1+auxn2; End;
If n2<>0 Then
Begin
limpiar; r:=n1+n2; n1:=r;
n2:=0;
End;
End;
2: Begin {Resta} convert;
If kn Then
Begin n1:=auxn1+auxn2; kn:=False; clean:=True; End
Else
Begin n2:=auxn1+auxn2; End; If n2<>0 Then
Begin
limpiar; r:=n1-n2;
n1:=r;
n2:=0; End;
End;
3: Begin {Division}
convert;
If kn Then Begin n1:=auxn1+auxn2; kn:=False; clean:=True; End
Else
Begin n2:=auxn1+auxn2; End;
If n2<>0 Then
Begin limpiar; r:=n1/n2;
n1:=r;
n2:=0;
End;
End; 4: Begin {Multiplicacion}
convert;
If kn Then
Begin n1:=auxn1+auxn2; kn:=False; clean:=True; End
Else Begin n2:=auxn1+auxn2; End;
If n2<>0 Then
Begin
limpiar; r:=n1*n2;
n1:=r; n2:=0;
End;
End;
End;
If flag_fun<>0 Then {Si la bandera de las funciones es diferente a 0, hacer} Begin {Mostrar en el Display el valor procesado}
Textcolor(15); Textbackground(1);
Gotoxy(48,7); Write(r:0:4);
End;
End; End;
End;
{ THIS PROGRAM WAS DOWNLOADED FOR MX.GEOCITIES.COM/MANUEL_BACH16/LENGUAJES }
{ THIS PROGRAM WAS CODED WITH TEACHING PURPOSES }
If r<>0 Then {Si r es diferente de 0, hacer}
Begin {Mostrar en el Display el valor Procedado}
Textcolor(15); Textbackground(1);
Gotoxy(48,7); Write(r:0:4); clean:=True; {Activar el limpiado de pantalla}
End;
End;
Procedure bye; Var
bye:Integer;
Begin
gotoxy(1,1); Randomize;
repeat Gotoxy(1,1); Textcolor(random(15)+1);
For bye:=1 to 80*46 do
Begin
write('Û');
End; For bye:=1 to 4 do Write(' GGR I Like u a Lot ');
For bye:=1 to 4 do Write('ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ');
For bye:=1 to 4 do Write(' GGR I Like u a Lot ');
For bye:=1 to 4 do Write('ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ');
For bye:=1 to 4 do Write(' GGR I Like u a Lot '); For bye:=1 to 80*50 do
Begin
write(' ');
End;
Delay(random(200)+5); Until Keypressed;
Gotoxy(35,25); Write('Fucking End...'); Delay(150);
end;
Begin{ Textmode(C80);} {Activar la pantalla Con 80 Columnas}
Textbackground(0); Clrscr; {Limpiar pantalla y colocar fondo negro}
point:=True; zero:=False; kn:=True; clean:=False; {Inicializar todos las banderas a utilizar}
lim:=9; time:=250; n1:=0; n2:=0; flag_fun:=0; {Inicializar variables y banderas enteras a utilizar}
calculator; {Dibujar la interfaz de la calculadora}{ THIS PROGRAM WAS DOWNLOADED FOR MX.GEOCITIES.COM/MANUEL_BACH16/LENGUAJES }
{ THIS PROGRAM WAS CODED WITH TEACHING PURPOSES }
While sel<>#27 do {Ciclo general del Programa}
Begin
sel:=Upcase(Readkey); {Leer un caracter de la consola} Textbackground(1); {Colorear el fondo de azul}
teclas; {Generar el efecto de las teclas}
Textcolor(15); {Colocar el color del texto}
Case sel of {Evaluar los posibles casos}
#49..#57: add; {Si es de 1 a 9 hacer} #48: cero; {Si es 0 hacer}
#46: punto; {Si es un punto evaluar}
#08: del; {Borrar un numero no deseado}
#43: Begin flag_fun:=1; funciones; End; {En caso de suma}
#45: Begin flag_fun:=2; funciones; End; {En caso de resta} #47: Begin flag_fun:=3; funciones; End; {En caso de division}
#42: Begin flag_fun:=4; funciones; End; {En caso de multiplicacion}
#32: Begin flag_fun:=5; funciones; End; {En caso de elevar al cuadrado}
#83: Begin flag_fun:=6; funciones; End; {En caso de sacar raiz}
#13: Begin funciones; clean:=True; End; {En caso de dar igua} #67: Begin limpiar; flag_fun:=0; r:=0; n1:=0; n2:=0; End; {En case de Borrar Todo}
End;
{ THIS PROGRAM WAS DOWNLOADED FOR MX.GEOCITIES.COM/MANUEL_BACH16/LENGUAJES }
{ THIS PROGRAM WAS CODED WITH TEACHING PURPOSES }
Textcolor(15); Textbackground(1); {Colorear el texto y fondo de las letras}
If n2=0 Then {Si numero 2, es 0 hacer}
Begin
For i:=9 downto lim do {Ir desde 9 hasta limite variable} Begin Gotoxy(i+48,7); Write(dis[i]); End; {Mostrar en pantalla los caracteres leidos}
End;
End;
textmode(C80+Font8x8);
Textbackground(0); Clrscr; bye;
End.
{ THIS PROGRAM WAS DOWNLOADED FOR MX.GEOCITIES.COM/MANUEL_BACH16/LENGUAJES }{ THIS PROGRAM WAS CODED WITH TEACHING PURPOSES }
{ CODING FINISHED . SUNDAY 9 OF OCTOBER 2005, 23:55 HRS. }
{ WOW!!!... I'T TOOKS ME ALMOST TWELVE HOURS } |