Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- namespace calc
- {
- public partial class Form1 : Form
- {
- const int nw = 4;
- const int nh = 4;
- const int np = (nw * nh) / 2;
- System.Drawing.Graphics g;//
- Bitmap pics;// картинки
- int cw, ch;//размер клетки
- int[,] field = new int[nw, nh];
- int nOpened = 0;
- int cOpened = 0;
- int[] open1 = new int[2];
- int[] open2 = new int[2];//координаты второй открытой клетки
- System.Windows.Forms.Timer timer1; // таймер
- private void cell( int i, int j)
- {
- int x, y; // координаты левого верхнего угла клетки
- x = i * (cw + 2);
- y = j * (ch + 2) + menuStrip1.Height;
- if (field[i, j] > 200)
- g.FillRectangle(SystemBrushes.Control x, y, cw + 2, ch + 2);
- if ((field[i, j] > 100) && (field[i, j] < 200))
- {
- g.DrawImage(pics, new Rectangle(x + 1, y + 1, cw, ch),
- new Rectangle((field[i, j] - 101) * cw, 0, cw, ch),
- GraphicsUnit.Pixel);
- g.DrawRectangle(Pens.Black, x + 1, y + 1, cw, ch);
- }
- if ((field[i, j] > 0) && (field[i, j] < 100))
- {
- g.FillRectangle(SystemBrushes.Control, x + 1, y + 1, cw, ch);
- }
- }
- private void drawField()
- {
- for (int i = 0; i < nw; i++)
- for (int j = 0; j < nh; j++) ;
- this.cell(i,j);
- }
- private void newGame()
- {
- }
- public Form1()
- {
- InitializeComponent();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement