Loryea (Normal User)
Pro
Messaggi: 165
Iscritto: 02/09/2011
|
Ho un problema con la modalità grafica di pascal:
Ho scritto un programmino, che deve ancora essere completato, si chiama "L'arrabbiato" che é la versione informatica del gioco classico.
Per ora però ho fatto il menù principale e l'opzione di aumentare i giocatori.
Non ci sono problemi di sintassi, ma solo logici: non riesco a far funzionare le frasi dopo "OuttextXY".
Ecco il programma:
Codice sorgente - presumibilmente Delphi |
PROGRAM Arrabbiato; Uses Crt,Graph; Var MPrincipal,X,Giocatori,Max,Scheda,Modo:integer; S:String[1]; bEGIN Scheda:=detect; Initgraph(scheda,modo,'C:\FPC'); If Graphresult<>grOK then Writeln('ERRORE: modalità grafica non installata correttamente'); Writeln('Il programma verrà chiuso entro 5 secondi'); delay(5000); halt; rectangle(0,0,1365,717); Setfillstyle(1,3); SetFillstyle(3,11); Floodfill(1,1,11); Outtextxy(1,50,'Benvenuto su ARRABBIATO'); Outtextxy(1,70,'1 Giocare all''arrabbiato'); Outtextxy(1,80,'2 Aggiungere giocatori'); Outtextxy(1,90,'3 Leggere le istruzioni'); Outtextxy(1125,155,'Giocatori: '); X:=1; Str(x,s); Outtext(s); Read(Mprincipal); Case MPrincipal of 2: Begin Scheda:=detect; Initgraph(scheda,modo,'C:\FPC'); If Graphresult<>grOK then Writeln('ERRORE: modalità grafica non installata correttamente'); Writeln('Il programma verrà chiuso entro 5 secondi'); delay(5000); halt; rectangle(0,0,1365,717); Setfillstyle(1,3); SetFillstyle(3,11); Floodfill(1,1,11); Outtextxy(100,120,'1= Aumentare; 2 = Diminuire'); Outtextxy(100,100,'Giocatori Attuali: '); Outtext(s); read(Giocatori); Case Giocatori of 1: Begin X:=X+1; Str(x,s); Outtext(s); Max:=4; If X>Max then Begin Sound(340); Delay(1000); Nosound; halt; end; End; 2: Begin X:=X-1; Str(x,s); Outtext(s); If X<1 then Begin Sound(340); Delay(1000); Nosound; halt; end; End; End; End; End; end.
|
|