Advertisement
Sooldierr

15stka - Form1

May 9th, 2017
372
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.32 KB | None | 0 0
  1. using System;
  2. using System.Windows.Forms;
  3.  
  4. namespace Gra_15stka__Forms_
  5. {
  6.     public partial class Form1 : Form
  7.     {
  8.         public Form1()
  9.         {
  10.             InitializeComponent();
  11.             for (int i = 0; i < Silnik.Rows; i++)
  12.             {
  13.                 for (int j = 0; j < Silnik.Columns; j++)
  14.                 {
  15.                     this.Controls.Add(Silnik.getButton(i, j));
  16.                 }
  17.             }
  18.            
  19.         }
  20.  
  21.         private void Form1_Load(object sender, EventArgs e)
  22.         {
  23.  
  24.         }
  25.  
  26.         private void bNewGame_Click(object sender, EventArgs e)
  27.         {
  28.             Silnik.NewGame();
  29.             label1.Text = "Liczba wykonanych ruchów: 0";
  30.         }
  31.  
  32.         private void bUp_Click(object sender, EventArgs e)
  33.         {
  34.             Silnik.Up();
  35.             Silnik.CheckWin(label1);
  36.         }
  37.  
  38.         private void bDown_Click(object sender, EventArgs e)
  39.         {
  40.             Silnik.Down();
  41.             Silnik.CheckWin(label1);
  42.         }
  43.  
  44.         private void bLeft_Click(object sender, EventArgs e)
  45.         {
  46.             Silnik.Left();
  47.             Silnik.CheckWin(label1);
  48.         }
  49.  
  50.         private void button1_Click(object sender, EventArgs e)
  51.         {
  52.             Silnik.Right();
  53.             Silnik.CheckWin(label1);
  54.         }
  55.  
  56.  
  57.     }
  58. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement