I love Pascal _and_ RPL :)
For Pascal on 48/49/50 have a look at :
HP Pascal Studio
here an exemple of program :
Mur de brique Pascal v0.1
And the code (newer version which correct some problem you can see on the video) :
Program CasseBriques;
{ v0.2 12/2/11 }
Uses SystemHP,CrtHPmini_49,GraphHP,GameHP,MathsHP_49;
Static Mvt : Array[1..8, 1..3, 1..2] Of Integer =
1, 0, 1,-1, 1,-1 {Direction 1 -3---2- }
, 0,-1, 1,-1, 1,-1 {Direction 2 4-----1 }
, 0,-1,-1,-1,-1,-1 {Direction 3 ------- }
,-1, 0,-1,-1,-1,-1 {Direction 4 ---O--- }
,-1, 0,-1, 1,-1, 1 {Direction 5 ------- }
, 0, 1,-1, 1,-1, 1 {Direction 6 5-----8 }
, 0, 1, 1, 1, 1, 1 {Direction 7 -6---7- }
, 1, 1, 1, 0, 1, 1;{Direction 8 }
Var i,j,Rx, Bx, By, Bx2, By2,
Dir, Choc, b, Vies,
Vitesse,Niveau, NBrique : Byte;
TapeMur, Perdu, GagneNiveau: Boolean;
Score,k: Integer;
c: Char;
Procedure DessineMur;
Begin
ClrScr;
Box(0,0,100,80); Bar(2,11,98,30);
For i:=1 To 5 Do ClearLineH(2,98,10+i*4);
For i:=1 To 14 Do ClearLineV(1+i*7,10,30);
Bar(Rx,78,Rx+11,79);
GotoXY(27,1); Write('Score');GotoXY(27,2);Write(Score);
GotoXY(27,7);Write('Niveau'); GotoXY(27,8);Write(Niveau);
Perdu:=False; GagneNiveau:=False;
Vitesse:=23-Niveau*3; NBrique:=0;
End;
Procedure BougeRaquette;
Var D : Char;
Begin
D:=' ';
For j:=1 To Vitesse Do Begin
If RightPressed Then D:='R';
If LeftPressed Then D:='L';
End;
Case D Of
'R': If Rx<88 Then
Begin
ClearLineV(Rx,78,79);
LineV(Rx+12,78,79);
Rx:=Rx+1;
End;
'L': If Rx>1 Then
Begin
ClearLineV(Rx+11,78,79);
LineV(Rx-1,78,79);
Rx:=Rx-1;
End;
End;
End;
Procedure BougeBalle;
Var Mx,My : Integer;
Begin
i:=1;
Repeat
Bar(Bx,By,Bx+1,By+1);
BougeRaquette;
Bx2:=Bx+Mvt[Dir,i,1];
By2:=By+Mvt[Dir,i,2];
If Bx2>=99 Then Begin
Case Dir Of
1: Dir:=4;
2: Dir:=3;
7: Dir:=6;
8: Dir:=5;
End;
Bx2:=98;
Exit;
End;
If Bx2<=0 Then Begin
Case Dir Of
3: Dir:=2;
4: Dir:=1;
5: Dir:=8;
6: Dir:=7;
End;
Bx2:=2;
Exit;
End;
If By2<=0 Then Begin
Case Dir Of
1: Dir:=8;
2: Dir:=7;
3: Dir:=6;
4: Dir:=5;
End;
By2:=4;
Exit;
End;
BougeRaquette;
If By2=77 Then Begin
k:=Bx-Rx;
If Dir In [5,6] And (k in [12..14] Or (k=15 And RightPressed)) Then k:=11
Else
If Dir in [7,8] And ((k>-4 and k<0) Or (k=-4 And LeftPressed)) Then k:=0;
If k in [0..11] Then
Case k Of
0,1 : Dir:=4;
2,3 : Case Dir Of 5,6: Dir:=4; 7,8: Dir:=3; End;
4..7 : Dir:=9-Dir;
8,9 : Case Dir Of 5,6: Dir:=1; 7,8: Dir:=2; End;
10,11: Dir:=1;
End
Else
Begin Perdu:=True; ClearBar(Bx,By,Bx+1,By+1); End;
Exit;
End;
If By2<32 Then Begin
Choc:=0; TapeMur:=False;
ClearBar(Bx,By,Bx+1,By+1);
If Point(Bx2,By2) Then Choc:=1;
If Point(Bx2+1,By2) Then Choc:=Choc+2;
If Point(Bx2+1,By2+1) Then Choc:=Choc+4;
If Point(Bx2,By2+1) Then Choc:=Choc+8;
Bar(Bx,By,Bx+1,By+1);
Case Dir Of
1,2: Case Choc Of
1,3: Begin TapeMur:=True; Dir:=9-Dir; End;
2 : Begin TapeMur:=True; Dir:=Dir+4; End;
6,4: Begin TapeMur:=True; Dir:=Dir+2; End;
End;
3,4: Case Choc Of
2,3: Begin TapeMur:=True; Dir:=Dir+2; End;
1 : Begin TapeMur:=True; Dir:=Dir+4; End;
9,8: Begin TapeMur:=True; Dir:=5-Dir; End;
End;
5,6: Case Choc Of
4,12: Begin TapeMur:=True; Dir:=9-Dir; End;
8 : Begin TapeMur:=True; Dir:=Dir-4; End;
1,9 : Begin TapeMur:=True; Dir:=Dir+2; End;
End;
7,8: Case Choc Of
8,12: Begin TapeMur:=True; Dir:=9-Dir; End;
4 : Begin TapeMur:=True; Dir:=Dir-4; End;
2,6 : Begin TapeMur:=True; Dir:=Dir-2; End;
End;
End;
If TapeMur Then Begin
NBrique:=NBrique+1;
Mx:=((Bx2-1) Div 7)*7 + 1;
My:=((By2-10)Div 4)*4 + 10;
ClearBar(Mx,My,Mx+7,My+4);
Score:=Score+5; GotoXY(27,2); Write(Score);i:=3;
End;
End;
i:=i+1;
If By2<77 Then Begin
ClearBar(Bx,By,Bx+1,By+1);
Bar(Bx2,By2,Bx2+1,By2+1);
End;
Bx:=Bx2; By:=By2;
Until i=4;
End;
Begin
ClrScr;
Box(15,20,115,60);
Box(16,19,114,59);
GotoXY(8,3); Write(' CASSE-BRIQUES ');
GotoXY(8,4); Write(' (c) Nemo 2011');
GotoXY(8,6); Write(' ENTER pour Jouer');
GotoXY(8,7);Write(' <- Deplace ->');
GotoXY(8,8);Write(' Exit : DEL');
Repeat Until KeyPressed; c:=ReadKey;
Score:=0; Vies:=10; Niveau:=1;Rx:=35;
Repeat
{Nouveau Niveau}
DessineMur;
Repeat
{Nouvelle balle}
By:=75; Bx:=Rx+5; Dir:=Random(3)+1;
GotoXY(27,4); Write('Vies');
GotoXY(27,5); Write(Vies-1);
Repeat Until EnterPressed; C:=ReadKey;
Perdu:=False;
DisableInterrupt;
Repeat
BougeBalle;
If NBrique=70 Then GagneNiveau:=True;
Until GagneNiveau Or Perdu Or ExitPressed;
EnableInterrupt;
ClearBar(Bx,By,Bx+1,By+1);
If Perdu Then Vies:=Vies-1;
Until Vies=0 Or GagneNiveau Or ExitPressed;
Niveau:=Niveau+1;
Until Vies=0 Or ExitPressed;
Repeat Until EnterPressed Or ExitPressed;
Edited: 11 Sept 2011, 2:56 p.m.