Skip to content

Commit

Permalink
manque algoEuler
Browse files Browse the repository at this point in the history
  • Loading branch information
Awale authored and Awale committed Jan 23, 2022
1 parent 2b2c055 commit 9b8c81c
Show file tree
Hide file tree
Showing 5 changed files with 420 additions and 47 deletions.
3 changes: 3 additions & 0 deletions Cavalier_Euler/Cavalier_Euler.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@
<EmbeddedResource Include="Form1.resx">
<DependentUpon>Form1.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Form2.resx">
<DependentUpon>Form2.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
Expand Down
25 changes: 23 additions & 2 deletions Cavalier_Euler/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -138,17 +138,38 @@ private void button1_Click(object sender, EventArgs e)
myButton.Enabled = false;
coups.Add(position);
if (testPositionAvailable() == 0)
{
label2.Text = "Fin du game, vous avez perdu en " + compteur + " essais !";
//finDuGame();

//finDuGame();
}
}

}


private void finDuGame()
{
Button buttonRejouer = new Button();
buttonRejouer.Text = "Voulez vous rejouer ?";
buttonRejouer.Location = new System.Drawing.Point(900, 300);
buttonRejouer.Name = ";";
buttonRejouer.Size = new System.Drawing.Size(60, 60);
buttonRejouer.UseVisualStyleBackColor = true;
buttonRejouer.Click += new System.EventHandler(this.buttonRejouer_Click);
buttonRejouer.Visible = true;
this.Controls.Add(buttonRejouer);
}

private void buttonRejouer_Click(object sender, EventArgs e)
{
initGame();
}

private void initGame()
{
coups = new List<int>();
compteur = 0; //nombre de coups
compteurAnnulation = 10;
stateInit = false;
position = 0; // ou est mon cavalier
trigger = false;
Expand Down
81 changes: 80 additions & 1 deletion Cavalier_Euler/Form2.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 9b8c81c

Please sign in to comment.