Skip to content

Commit ae3dc6a

Browse files
author
Sylvain Maltais
committed
Corrige le bogue de ResetGame mal positionné
1 parent 42c4ea8 commit ae3dc6a

File tree

1 file changed

+43
-43
lines changed

1 file changed

+43
-43
lines changed

RENJU.PAS

+43-43
Original file line numberDiff line numberDiff line change
@@ -340,49 +340,6 @@ Procedure WriteCommand(S:String);Begin
340340
Write(Copy(S,2,Length(s)-1));
341341
End;
342342

343-
Procedure ResetGame(FirstGame:Boolean);
344-
Var
345-
I,J:IndexType;
346-
D:0..3;
347-
C:ColorType;
348-
Begin
349-
SetUpScreen;
350-
If FirstGame Then Begin
351-
TextColor(HeadingColor);
352-
GotoXY(49, 1);
353-
Write('R E N J U');
354-
GotoXY(49,3);
355-
WriteCommand('Nouvelle partie ');
356-
WriteCommand('Quitte ');
357-
GotoXY(49,4);
358-
WriteCommand('Auto ');
359-
WriteCommand('Jouer ');
360-
WriteCommand('Indice');
361-
GotoXY(49,5);
362-
WriteHelp('?-pour Aide ', 1);
363-
FirstGame := false;
364-
End
365-
Else
366-
Begin
367-
ClearMsg;
368-
ClearMove;
369-
End;
370-
For I:=1 to N do For J:=1 to N do Begin
371-
Board[I,J]:=Empty;
372-
For C:=Cross to Nought do Begin
373-
Value[I,J,C]:=0;
374-
For D:=0 to 3 do Line[D,I,J,C]:=0;
375-
End;
376-
End;
377-
Player:=Cross;
378-
TotalLines:=2*2*(N*(N-4)+(N-4)*(N-4));
379-
GameWon:=False;
380-
For I:=1 to 3 do Begin
381-
FindMove(X,Y);
382-
MakeMove(X,Y);
383-
End;
384-
End;
385-
386343
Function OpponentColor(Player:ColorType):ColorType;Begin
387344
If Player=Cross Then OpponentColor:=Nought
388345
Else OpponentColor:=Cross;
@@ -532,6 +489,49 @@ Begin
532489
End;
533490
End;
534491

492+
Procedure ResetGame(FirstGame:Boolean);
493+
Var
494+
I,J:IndexType;
495+
D:0..3;
496+
C:ColorType;
497+
Begin
498+
SetUpScreen;
499+
If FirstGame Then Begin
500+
TextColor(HeadingColor);
501+
GotoXY(49, 1);
502+
Write('R E N J U');
503+
GotoXY(49,3);
504+
WriteCommand('Nouvelle partie ');
505+
WriteCommand('Quitte ');
506+
GotoXY(49,4);
507+
WriteCommand('Auto ');
508+
WriteCommand('Jouer ');
509+
WriteCommand('Indice');
510+
GotoXY(49,5);
511+
WriteHelp('?-pour Aide ', 1);
512+
FirstGame := false;
513+
End
514+
Else
515+
Begin
516+
ClearMsg;
517+
ClearMove;
518+
End;
519+
For I:=1 to N do For J:=1 to N do Begin
520+
Board[I,J]:=Empty;
521+
For C:=Cross to Nought do Begin
522+
Value[I,J,C]:=0;
523+
For D:=0 to 3 do Line[D,I,J,C]:=0;
524+
End;
525+
End;
526+
Player:=Cross;
527+
TotalLines:=2*2*(N*(N-4)+(N-4)*(N-4));
528+
GameWon:=False;
529+
For I:=1 to 3 do Begin
530+
FindMove(X,Y);
531+
MakeMove(X,Y);
532+
End;
533+
End;
534+
535535
Procedure ClearBuffer;
536536
Var
537537
Ch:Char;

0 commit comments

Comments
 (0)