Pascal/Turbo Pascal - Turbo Pascal* Programa el Ahorcado, me presenta unos problemas. Ayuda??

 
Vista:
sin imagen de perfil

Turbo Pascal* Programa el Ahorcado, me presenta unos problemas. Ayuda??

Publicado por Yousaf Jamal (3 intervenciones) el 10/12/2014 20:34:04
Hola Colegas, espero que esten Bien...
eh venido aca buscando ayuda, ya que estoy haciendo un programa que me han dejado de tarea.
Nuestro Prof, Solo nos dio unas hojas con el programa dentro, y nosotros solo la teniamos que copiar en el Turbo Pascal...

Bien, le e copiado todo. y me esta presentado un Error... Uno NO, Varios Errores..
y quiero que me ayuden a solucionarle!
Les dejare imagenes del programa! y mas abajo como me ah quedado. y Ayudenme a Ponerle a Funcionar.
El juego *EL AHORCADO* Porfavor

Imagenes del trabajo que debia de copiar en pascal.
2drgw9l

117aeys

jt6kx1

Este es el programa copiado por mi... al parecer cometi errores al copiarlo.. Ayudenme a corregir.
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
Program Juego_Ahorcado; ahorcado
Uses crt, softcrt, softcmd, qetmouse, visual;
Var
 I, N,
 Error    : integer;
 Adivina,
 Palabra  : String[25];
 Letra    : char;
 Ahorcado,
 HayLetra,
 Salir     : Boolean;
 Panta     : ptrscr;
 
Procedure Iniciar;
Begin
 WriteLn('Ahorcado version 1.(c) Copyright 1997,98 ING Alexandro Baez');
 SetAllASCII;
 SetCursor(Off); setBlink(Off);
 CheckBreak := False;
 VerifyMouse; ft
 FXMouse := True; setMouseMenu := True;
End; { Iniciar }
 
Procedure SalirDOS;
Begin
 SetMouse(Hide); setBlink(On); setcursor(on);
 RestoreASCII;
 Color($07); Clrscr;
 writeLn;
 WriteLn('Por: Alexandro Ant. Baez Copyright 1997'); .
 writeLn('alexandro11@yahoo.com.com );
 Halt(0);
End; { SalirDOS }


Procedure Disenno;
Begin
 Iniciar; Clrscr;
 If changeASCII then wnteAttr(1,1,$0f, #211#6)
 Else writeAttr(1,1,$0f, '[]');
 FillColor(1,25,80,25, $f0); FillColor(1,2,80,2, $f0),
 Centrar(1, 'Ahorcado'); Fillco1or(3,1,80,1, $1f);
 FillColor(1,3,80,24, $8f);
 Color($8b);
 writeMem(50,8,  ' ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿');
 Color($8f);  For N:=1 to 14 do WriteMem(69,8+N, #219);
 WriteMem(50,23, ' ÛÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÛÜÜÜÜÛ');
 NormVideo;
End; { Disenno }

Procedure Cabeza;
Begin
End;
 color($8a); WriteMem(49,9, 'ÚÄÄÄ¿  ');  WriteMem(48,10,  'úù,   À¿');
 WriteMem(48,11, 'À¿    ÚÙ');  WriteMem(49,12, 'ÀÄÂÄÙ'); Normvideo;
End;

Procedure Troncco:
Begin
 Color($8a); WriteMem(51,13, 'Å '); writeMem(51,14, '3');
 WriteMem(51,15,  ,'3'); WriteMem(51,16,  '3'); NormVideo;
End;

Procedure Brazo1;
Begin
 Color($8a); WriteMem(48,13,  'ÚÄÄ'); WriteMem(47,14,  'úù  ');
 WriteMem(47,15, '3 '): WriteMem(47,16, 'Á'); NormVideo;
 End.

Procedure Brazo2;
Begin
 Color($8a); writeMem(52,13,  'ÄÄ¿ ');   WriteMem(52,14,  '  À¿ ');
 WriteMem(52,15, '   3 ') writemem(52,16,  ' À ' normvideo;
End;

Procedure Pierna1;
Begin 
 Color($8a); WriteMem(45,17, '      ÚÄÁ');  WriteMem(45,18, '   3  ')
 writeMem(45,19, '    ÚÙ  '); writeMem(45,20, '    3 ');
 WriteMem(45,21, '    Á   '); NormVideo;
End; 

Procedure Pierna2;
Begin
 Color($8a); WriteMem(52,17, 'Ä¿ '); WriteMem(52,18,  ' 3 ');
 WriteMem(52,19,  ' Á¿ '); WriteMem(52,20,  '    3'); WriteMem(52,21, 'Á');
 NormVideo;
 End;
 
Begin
 Clrscr;
 StrPW := True;
 Disenno;
 Color($70); For I:=1 to 26 do WriteMem((I*3)-1,4, #32+ chr(64+I) + %32);
Repeat
  Ahorcado := False;        Salir := False;
  Fillcolor(1,5,80,7, $88); FillColor(40,9,60,22, $88);
  New(Panta); SaveScr(Pantaᶺ);
  Randomize;
  Adivina : = 11 ;
  ventana(10,'Palabra clave', 25,10,56,17, $bf, On,On);
  Color($b0); writeMem(27,15,'['); WriteMem(54,15,']');
  Centrar(12, 'Ingrese la palabra para');
  centrar(13, '  adivinar :');
  color($0f); ,
  Palabra := LeerCad(Size0f(Palabra), 27,15, '', On,Off);
  setcursor(off);
  restoreScr(Pantaᶺ, 25,10,58,18);
  CuadroOut(2,5,3+(Length(Palabra)*3),7, $82);
  Fillcolor(2,6,3+(Length(Palabra)*3),6, $f2);
  For N:=1 to Length(Palabra) do
   If palabra[N] = #32 then lnsert(#32, Adivina, N)
   Else Insert('?', Adivina, N);
  For N:=1 to Length(Palabra) do WriteColor((N*3),6, $f2, #32+Adivina[N]+#32);
  Error .:= 0;
Repeat
  For I:=1 to 26 do item[1]:= ' <' + Chr(64+I) + #32;
  Color($80);
  Repeat
    MenuBar(Horizont, BNormal, 26, 2,4, 0, $f0,$0b,$lf)5
  Until not clickout;
  Letra := Item[Positem][2];
  HayLetra := False;
  For N:=1 to Length(Palabra) do
  If Upcase(Palabra[N]) = upcase(Letra) then
    Begin Adivina[N] := Letra; HayLetra := True; End;
  If not HayLetra then Inc(Error);
  For N:=1 to Length(Palabra) do writeColor((N*3) ,6, $f2, #32+Adivina[N]+#32);
  Case Error of
    1:Cabeza; 2:Tronco; 3:brazol; 4:brazo2; 5:pierna1; 6:pierna2;
 End; 
  If Error = 6 then Ahorcado := True;
 Until (Upper(Palabra)=upper(Adivina)) or (Ahorcado);
 SaveScr(Pantaᶺ);
 WMinY:=3; WMaxY:=24;
 For N:=l to Lenqth(Palabra) do writeColor((N*3),6, $f2, #32+Palabra[N]+#32)
  If Ahorcado then windFloat('Ahorcado', 'usted ha perdido el juego' , Pantaᶺ, $4f)
  Else WindFloat ('Felicitaciones!', 'usted ha ganado el juego' Pantaᶺ, $2f)
  WMinY:=l; WMaxY:=25;
  ventana(10,'Salir del Ahorcado', 22,10,58,16, $9f, On,on)
  Color($9f); Centrar(12, 'Desea continuar el juego ?');
  Color($90); PosItem 1;
  Item[1]  := '   <S!   '; Item[2]  := '   <NO!   ';
  MenuBar(Horizont, BPush, 2, 25, 14, 4, $9f, On,On);
  RestoreScr(Pantaᶺ, 22,10,60,17)
 Until Salir;
Dispose(Panta);
SalirDOS;
End.

Porfavor, tengo que entregar esto antes del viernes 12/12/2014
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

Turbo Pascal* Programa el Ahorcado, me presenta unos problemas. Ayuda??

Publicado por ramon (2 intervenciones) el 10/12/2014 23:33:35
Disculpa mi pregunta es tienes todas las unidades que te marca.
crt, softcrt, softcmd, qetmouse, visual;
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar
sin imagen de perfil

Turbo Pascal* Programa el Ahorcado, me presenta unos problemas. Ayuda??

Publicado por Yousaf Jamal (3 intervenciones) el 11/12/2014 00:16:38
Hola, Disculpa Ramón. Pero en esto soy todo un novato. Con unidad no se a que te referiste...
Nuestro maestro simplemente me dio el código impreso en hojas sueltas para que lo digite e ejecuta el programa.
Lo dirige y me da un error de Begin 36 al darle Run en pascal...

Y aparte de esas hojas sueltas, nos dio este URL para que ejecutemos el pascal por acá? Y no entiendo nada
https://www.dropbox.com/s/x0roakdzc5igj2g/AHORCADO.rar?dl=0

Porfavor! No me culpen. Estoy en 3er teórico. Y nos ha tocado tomar un técnico. Y de una manera apresurada nos metieron a programar y pues no se.

Les agradeceré si me ayudan! En fin si tengo que pagar. No tengo problema .. Pago alante y utilizo paypal. Mi Skype es yousafjamald. Pero es urgente. Gracias
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

Turbo Pascal* Programa el Ahorcado, me presenta unos problemas. Ayuda??

Publicado por ramon (2158 intervenciones) el 13/12/2014 13:13:34
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
{Primero tienes que bajarte las unidades que tienes en  https://www.dropbox.com/s/x0roakdzc5igj2g/AHORCADO.rar?dl=0  con ellas funciona pero no muy bien a qui lo tienes correjido }
 
Program Juego_Ahorcado;
Uses
  crt, softcrt, softcmd, getmouse, visual;
Var
 I, N,
 Error    : integer;
 Adivina,
 Palabra  : String[25];
 Letra    : char;
 Ahorcado,
 HayLetra,
 Salir     : Boolean;
 Panta     : ptrscr;
 
Procedure Iniciar;
Begin
 WriteLn('Ahorcado version 1.(c) Copyright 1997,98 ING Alexandro Baez');
 SetAllASCII;
 SetCursor(Off); setBlink(Off);
 CheckBreak := False;
 VerifyMouse;
 FXMouse := True; setMouseMenu := True;
End; { Iniciar }
 
Procedure SalirDOS;
Begin
 SetMouse(Hide); setBlink(On); setcursor(on);
 RestoreASCII;
 Color($07); Clrscr;
 writeLn;
 WriteLn('Por: Alexandro Ant. Baez Copyright 1997');
 writeLn('alexandro11@yahoo.com.com');
 Halt(0);
End; { SalirDOS }
 
 
Procedure Disenno;
Begin
 Iniciar; Clrscr;
 If changeASCII then
 writeAttr(1,1,$0f, #211#6)
 Else writeAttr(1,1,$0f, '[]');
 FillColor(1,25,80,25, $f0);
  FillColor(1,2,80,2, $f0);
 Centrar(1, 'Ahorcado');
  FillColor(3,1,80,1, $1f);
 FillColor(1,3,80,24, $8f);
 Color($8b);
 writeMem(50,8,  ' ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿');
 Color($8f);  For N:=1 to 14 do WriteMem(69,8+N, #219);
 WriteMem(50,23, ' ÛÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÛÜÜÜÜÛ');
 NormVideo;
end; { Disenno }
procedure Cabeza;
begin
 color($8a);
  WriteMem(49,9, 'ÚÄÄÄ¿  ');
  WriteMem(48,10,  'úù,   À¿');
 WriteMem(48,11, 'À¿    ÚÙ');  WriteMem(49,12, 'ÀÄÂÄÙ'); Normvideo;
end;
 
procedure Tronco;
begin
 Color($8a); WriteMem(51,13, 'Å '); writeMem(51,14, '3');
 WriteMem(51,15,'3'); WriteMem(51,16,  '3'); NormVideo;
end;
 
procedure Brazo1;
Begin
 Color($8a); WriteMem(48,13,  'ÚÄÄ'); WriteMem(47,14,  'úù  ');
 WriteMem(47,15, '3 '); WriteMem(47,16, 'Á'); NormVideo;
 End;
 
Procedure Brazo2;
Begin
 Color($8a); writeMem(52,13,  'ÄÄ¿ ');   WriteMem(52,14,  '  À¿ ');
 WriteMem(52,15, '   3 ');
 writemem(52,16,  ' À ');
 normvideo;
End;
 
Procedure Pierna1;
Begin
 Color($8a); WriteMem(45,17, '      ÚÄÁ');  WriteMem(45,18, '   3  ');
 writeMem(45,19, '    ÚÙ  '); writeMem(45,20, '    3 ');
 WriteMem(45,21, '    Á   '); NormVideo;
End;
 
Procedure Pierna2;
Begin
 Color($8a); WriteMem(52,17, 'Ä¿ '); WriteMem(52,18,  ' 3 ');
 WriteMem(52,19,  ' Á¿ '); WriteMem(52,20,  '    3'); WriteMem(52,21, 'Á');
 NormVideo;
 End;
 
Begin
 Clrscr;
 StrPW := True;
 Disenno;
 Color($70); For I:=1 to 26 do WriteMem((I*3)-1,4, #32+ chr(64+I) + #32);
Repeat
  Ahorcado := False;
  Salir := False;
  Fillcolor(1,5,80,7, $88); FillColor(40,9,60,22, $88);
  New(Panta); SaveScr(Panta^);
  Randomize;
  Adivina := '';
  ventana(10,'Palabra clave', 25,10,56,17, $bf, On,On);
  Color($b0); writeMem(27,15,'['); WriteMem(54,15,']');
  Centrar(12, 'Ingrese la palabra para');
  centrar(13, '  adivinar :');
  color($0f);
  Palabra := LeerCad(Sizeof(Palabra), 27,15, '', On,Off);
  setcursor(off);
  restoreScr(Panta^, 25,10,58,18);
  CuadroOut(2,5,3+(Length(Palabra)*3),7, $82);
  Fillcolor(2,6,3+(Length(Palabra)*3),6, $f2);
  For N:=1 to Length(Palabra) do
   If palabra[N] = #32 then Insert(#32, Adivina, N)
   Else Insert('?', Adivina, N);
  For N:=1 to Length(Palabra) do WriteColor((N*3),6, $f2, #32+Adivina[N]+#32);
  Error := 0;
Repeat
  For I:=1 to 26 do item[1]:= ' <' + Chr(64+I) + #32;
  Color($80);
  Repeat
    MenuBar(Horizont, BNormal, 26, 2,4, 0, $f0,$0b,$1f);
  Until not clickout;
  Letra := Item[Positem][2];
  HayLetra := False;
  For N:=1 to Length(Palabra) do
  If Upcase(Palabra[N]) = upcase(Letra) then
    Begin Adivina[N] := Letra; HayLetra := True; End;
  If not HayLetra then
  Inc(Error);
  For N:=1 to Length(Palabra) do
  writeColor((N*3) ,6, $f2, #32+Adivina[N]+#32);
  Case Error of
    1:Cabeza;
    2:Tronco;
    3:brazo1;
    4:brazo2;
    5:pierna1;
    6:pierna2;
 End;
  If Error = 6 then
  Ahorcado := True;
 Until (Upper(Palabra)=upper(Adivina)) or (Ahorcado);
 SaveScr(Panta^);
 WMinY:=3; WMaxY:=24;
 For N:=1 to Length(Palabra) do
 writeColor((N*3),6, $f2, #32+Palabra[N]+#32);
  If Ahorcado then
  windFloat('Ahorcado', 'usted ha perdido el juego' , Panta^, $4f)
  Else
  WindFloat ('Felicitaciones!', 'usted ha ganado el juego', Panta^, $2f);
  WMinY:=1;
  WMaxY:=25;
  ventana(10,'Salir del Ahorcado', 22,10,58,16, $9f, On,on);
  Color($9f); Centrar(12, 'Desea continuar el juego ?');
  Color($90);
  PosItem := 1;
  Item[1]  := '   <SI!   '; Item[2]  := '   <NO!   ';
  MenuBar(Horizont, BPush, 2, 25, 14, 4, $70, $f1,$44);
  if positem = 2 then
  salir := true;
  RestoreScr(Panta^, 22,10,60,17)
 Until Salir;
Dispose(Panta);
SalirDOS;
End.
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

Turbo Pascal* Programa el Ahorcado, me presenta unos problemas. Ayuda??

Publicado por ramon (2158 intervenciones) el 15/12/2014 00:01:47
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
{Mira este ejemplo es abierto}
 
 program ejemplo;
  uses
     crt, dos;
   type
      string25 = string[25];
 
   const
     letras : array[0..26] of char = (
     'A','B','C','D','E','F','G','H','I','J',
     'K','L','M','N','O','P','Q','R','S','T',
     'U','V','W','X','Y','Z','¥');
  var
    x1, y1 : integer;
    le, tecla : char;
    frase : string25;
   regs : registers;
   esist, mouse, raton : boolean;
   pulsado : integer;
 
 
  function mousepresente : boolean;
  begin
      regs.ah := $00;
      regs.al := $00;
      intr($33,regs);
      if regs.ax <> 0 then
      mousepresente := true
    else
      mousepresente := false;
  end;
 
  procedure muestramouse;
  begin
      raton := false;
      if mousepresente then
      begin
          regs.ah := $00;
          regs.al := $01;
          intr($33,regs);
          raton := true;
      end;
  end;
 
  procedure ocultamouse;
  begin
      if raton = true then
      begin
         regs.ah := $00;
         regs.al := $02;
         intr($33,regs);
         raton := false;
       end;
  end;
 
   procedure ponposicionmouse(xt, yt : word);
  begin
      regs.ax := $04;
      regs.cx := (xt - 1) * 8;
      regs.dx := (yt - 1) * 8;
      intr($33,regs);
  end;
 
  function posxmouse : word;
  begin
     regs.ax := $03;
     intr($33,regs);
     posxmouse := regs.cx div 8;
  end;
 
  function posymouse : word;
  begin
     regs.ax := $03;
     intr($33,regs);
     posymouse := regs.dx div 8;
  end;
 
  function botonmouse : word;
  begin
      botonmouse := 0;
      regs.ah := $00;
      regs.al := $03;
      intr($33,regs);
      botonmouse := regs.bx
  end;
 
  procedure zonajuego(x1, y1, x2, y2 : integer);
  var
    x, y : byte;
    begin;
       clrscr;
       TextBackground(7);
       gotoxy(2,2);write('                                           ',
                            '                                   ');
       TextBackground(0);
       textcolor(3);
       gotoxy((80 div 2) - 14,2);write(' *** JUEGO DEL AHORCADO *** ');
       textcolor(7);
       gotoxy(x1,y1);
       for x := x1 + 1 to x2 do
       write('Í');
       gotoxy(x1,y2);
       for x := x1 + 1 to x2 do
       write('Í');
       for y := y1 + 1 to y2 - 1 do
       begin
         gotoxy(x1,y);write('³');
         gotoxy(x2,y);write('³');
       end;
     gotoxy(x1,y1);write('Õ');
     gotoxy(x2,y1);write('¸');
     gotoxy(x1,y2);write('Ô');
     gotoxy(x2,y2);write('¾');
     x1 := 1;
     for le := 'A' to 'Z' do
     begin
       gotoxy(0 + x1,26);write(le);
       x1 := x1 + 3;
     end;
       gotoxy(0 + x1,26);write('¥');
   end;
 
  procedure lahorca;
  var
    k, p : integer;
  begin
     for k := 1 to 19 do
     begin
     gotoxy(70,4 + k);write(#219);
     end;
     for p := 1 to 20 do
     begin
        gotoxy(52 + p,23);write(#219);
     end;
     gotoxy(54,19);write('Ú           Â');
     gotoxy(54,20);write('³           ³');
     gotoxy(54,21);write('³           ³');
     gotoxy(54,22);write('Á           Á');
     gotoxy(55,19);write('ÄÄÄÄÄÄÄÄÄÄÄ');
     gotoxy(67,19);write('ÄÄÄ');
     for k := 1 to 11 do
     begin
     gotoxy(59 + k,4);write(#220);
     end;
     gotoxy(60,5);write('³');
     gotoxy(60,6);write('¨');
  end;
 
  procedure caeplataforma;
  begin
     gotoxy(55,19);write('           ');
  end;
 
  procedure elahorcado(xc, yc : integer);
  var
    o : integer;
  begin
     if yc = 6 then
     begin
     for o := 1 to 11 do
     begin
        gotoxy(xc - 4,7 + o);write('        ');
     end;
   end
 else
    begin
       for o := 1 to 11 do
       begin
        gotoxy(xc - 4,7 + o);write('        ');
       end;
    end;
    if yc = 11 then
    begin
     gotoxy(60,7);write('*');
     gotoxy(60,8);write('*');
     gotoxy(60,9);write('*');
     gotoxy(60,10);write('*');
     gotoxy(59,11);write('( )');
     textcolor(11);
     gotoxy(xc,yc);write(chr(2));
     gotoxy(xc,yc + 1);write('|');
     gotoxy(xc - 2,yc + 2);write('/---\');
     gotoxy(xc,yc + 3);write('!');
     gotoxy(xc - 1,yc + 4);write('( )');
     gotoxy(xc - 1,yc + 5);write('/-\');
     gotoxy(xc - 2,yc + 6);write('|   |');
     gotoxy(xc - 2,yc + 7);write('³   ³');
     textcolor(7);
     gotoxy(xc - 2,yc + 8);write('ÁÄÄÄÁ');
    end
  else
      begin
         gotoxy(60,7);write('*');
         gotoxy(60,8);write('*');
         gotoxy(60,9);write('*');
         gotoxy(60,10);write('*');
         gotoxy(60,11);write('*');
         gotoxy(60,12);write('*');
         gotoxy(60,13);write('*');
         gotoxy(60,14);write('*');
         gotoxy(59,15);write('( )');
         textcolor(11);
         gotoxy(xc,yc);write(chr(2));
         gotoxy(xc,yc + 1);write('|');
         gotoxy(xc - 2,yc + 2);write('/---\');
         gotoxy(xc,yc + 3);write('!');
         gotoxy(xc - 1,yc + 4);write('( )');
         gotoxy(xc - 1,yc + 5);write('/-\');
         gotoxy(xc - 2,yc + 6);write('|   |');
         gotoxy(xc - 2,yc + 7);write('-   -');
         textcolor(7);
      end;
  end;
 
  procedure sesalva;
  var
    t : integer;
  begin
     for t := 1 to 12 do
     begin
        gotoxy(60 - 4,6 + t);write('        ');
     end;
      gotoxy(55,19);write('ÄÄÄÄÄÄÄÄÄÄÄ');
  end;
 
  procedure entradafrase(var ff : string25);
  var
    v : integer;
    sal : boolean;
   begin
      fillchar(ff,26,' ');
      v := 1;
      gotoxy(10,28);write('Entre fase : ');
      sal := false;
   repeat
      tecla := upcase(readkey);
      if tecla in['A'..'Z',#165] then
      begin
         ff[v] := tecla;
         ff[0] := chr(v);
         gotoxy(22 + v,28);write('*');
         v := v + 1;
         if v > 25 then
         sal := true;
      end;
      if tecla = #8 then
      begin
         v := v - 1;
         if v < 1 then
         v := 1;
         ff[v] := ' ';
         ff[0] := chr(v);
         gotoxy(22 + v,28);write(' ');
      end;
   until (tecla = #13) or (sal = true);
   end;
 
   function tomaletra(pos : word) : boolean;
   var
   sali : boolean;
   num : word;
   begin
      tomaletra := false;
      sali := false;
      num := 0;
      repeat
        if num = pos then
        sali := true
      else
        num := num + 3;
      until (sali = true) or (num > 80);
      if sali = true then
      tomaletra := true;
   end;
 
  procedure adibina;
  var
    paso, i, az : word;
    letra : char;
    b : integer;
    ymos, xmos : word;
    respuesta : string25;
  begin
     entradafrase(frase);
     gotoxy(10,28);write('***** Marque Sobre La Letra [Mouse Y Boton Izq.] *****');
     if mousepresente then
     begin
     ponposicionmouse(1,26);
     muestramouse;
     elahorcado(60,11);
     paso := 0;
     b := 1;
     gotoxy(10,29);write('Su Respuesta = ');
     for i := 1 to length(frase) do
     begin
     gotoxy(24 + i,29);write('±');
     end;
     repeat
         az := 0;
         if botonmouse = 1 then
         begin
         ymos := posymouse;
         xmos := posxmouse;
         delay(360);
    case ymos of
  25 : begin
         if tomaletra(xmos) then
         begin
         if xmos < 0 then
         xmos := 0;
         if xmos > 80 then
         xmos := 80;
         if (xmos > 0) and (xmos < 80) then
         xmos := xmos div 3;
         az := xmos;
         if az in[0..26] then
         begin
         respuesta[b] := letras[az];
         respuesta[0] := chr(b);
         b := b + 1;
         gotoxy(23 + b,29);write(respuesta[b - 1]);
       end;
      end;
    end;
  end;
 end;
     until b > length(frase);
     ocultamouse;
     gotoxy(1,29);clreol;
     if respuesta = frase then
     begin
     sesalva;
     textcolor(14);
     gotoxy(23,29);write('    Salvado De La Horca');
     textcolor(7);
     end
  else
     begin
     caeplataforma;
     elahorcado(60,15);
     textcolor(4);
     gotoxy(23,29);write('    Murio En La Horca La Frase Es = ',frase);
     textcolor(7);
     end;
     end;
  end;
 
  procedure iniciojuego;
  var
     gh : char;
     u, c : integer;
  begin
     clrscr;
     c := 1;
     gotoxy(25,2);write('////////////////////////////////');
     textcolor(12);
     gotoxy(25,3);write('[***** Juego Del Ahorcado *****]');
     textcolor(7);
     gotoxy(25,4);write('\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\');
     gotoxy(20,28);write('############################################');
     textcolor(2);
     gotoxy(20,29);write('<<<< Pulse Una Tecla Para Iniciar Juego >>>>');
     textcolor(7);
     gotoxy(20,30);write('############################################');
     u := 1;
     repeat
        gotoxy(1,15);clreol;
        delay(20);
        textcolor(u);
        gotoxy(c,15);write(chr(2),' Ahorcado ',chr(1));
        delay(20);
        c := c + 1;
        if c > 69 then
        c := 1;
        u := u + 1;
        if u = 8 then
        u := 9;
        if u > 15 then
        u := 1;
     until keypressed;
     textcolor(7);
  end;
 
 
  begin
    textcolor(7);
    iniciojuego;
    repeat
      clrscr;
      zonajuego(2,3,79,24);
      lahorca;
      adibina;
    gotoxy(1,28);clreol;
    textcolor(12);
    gotoxy(20,28);write('**** Desea Jugar Otra Partida [S/N] ****');
    textcolor(7);
    repeat
    le := upcase(readkey);
    until le in['S','N'];
    until le = 'N'
  end.
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar
sin imagen de perfil

Turbo Pascal* Programa el Ahorcado, me presenta unos problemas. Ayuda??

Publicado por David (224 intervenciones) el 16/12/2014 11:46:05
No sé si a vosotros os pasa, pero me dice que hay un error en la versión de las TPU, es decir que, supuestamente, se han hecho cambios desde la última compilación y como no dispongo de los fuentes de las tpu no puedo recompilarlas y no ejecuta el programa.
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

Turbo Pascal* Programa el Ahorcado, me presenta unos problemas. Ayuda??

Publicado por ramon (2158 intervenciones) el 16/12/2014 23:12:45
Funcionar funciona pero con fallos.
Las unidades compilan sin problema claro eso en turbo pascal 7 en los de mas no se.
Pero el programa que tienes arriba te puede orientar de como esta echo sin incluir unidades
no estandar de pascal.
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar
sin imagen de perfil

Turbo Pascal* Programa el Ahorcado, me presenta unos problemas. Ayuda??

Publicado por David (224 intervenciones) el 17/12/2014 10:23:00
Yo he probado con turbo pascal 7 y me dice "Unit version mismatch", o sea, error al tratar de utilizar alguna unidad porque ha cambiado tras la última compilación
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

Turbo Pascal* Programa el Ahorcado, me presenta unos problemas. Ayuda??

Publicado por ramon (2158 intervenciones) el 17/12/2014 14:09:08
Yo lo baje de donde ponía y son tpu con fecha de creación 19/1/2001
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar
sin imagen de perfil

Turbo Pascal* Programa el Ahorcado, me presenta unos problemas. Ayuda??

Publicado por David (224 intervenciones) el 17/12/2014 16:58:29
Ya descubrí donde está el error, aunque no termino de entender porqué ocurre eso. Resulta que yo traté de ejecutar el programa con el turbo pascal que yo tenía instalado, y al parecer, al correr el programa con el turbo.exe instalado, da ese error. Descargué el turbo.exe que pone en el enlace, puse a correr el programa y ya ejecuta, aunque, como tú decías, con errores ;-)
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar