NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

{
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Windows.Forms;

public partial class Form1 : Form
{
public Form1() { InitializeComponent(); }

Random rnd = new Random();
Timer timer = new Timer();
//int[] mayinlar = new int[30];
//List<int> mayinlars = new List<int>();

private void Form1_Load(object sender, EventArgs e)
{
this.Size = new Size(560, 583);
this.Text = "Mayın Tarlası";
timer.Interval = 100;
timer.Tick += Timer_Tick;

#region Örnek 1
//for (int i = 0; i < 30; i++)
//{
// int sayi = rnd.Next(1, 290); // min : 1, max : 289
// // dizinin içerisinde sayı yok ise.

// //if (Array.Exists(mayinlar, x => x != sayi))
// if (Array.IndexOf(mayinlar, sayi) == -1)
// {
// mayinlar[i] = sayi;
// }
// else
// {
// i--;
// }
//}

//Array.Sort(mayinlar);
#endregion

#region Örnek 2
//while (mayinlars.Count() < 30)
//{
// int sayi = rnd.Next(1, 290);

// if (!mayinlars.Contains(sayi))
// {
// mayinlars.Add(sayi);
// }
//}
//mayinlars.Sort();
#endregion

int[] mayinlar = Enumerable.Range(1, 290).OrderBy(x => Guid.NewGuid()).Take(30).ToArray();

for (int i = 1; i < 290; i++)
{
// instance (yeni bir örnek) alma
PictureBox pcb = new PictureBox();
pcb.Width = 30;
pcb.Height = 30;
//pcb.BackColor = Color.Tomato;
pcb.BackColor = Color.FromArgb(rnd.Next(256), rnd.Next(256), rnd.Next(256));
pcb.Margin = new Padding(1);
pcb.Tag = Array.Exists(mayinlar, x => x == i) ? true : false;
pcb.Click += Pcb_Click;
flowLayoutPanel1.Controls.Add(pcb);
}
timer.Start();
}

private void Pcb_Click(object sender, EventArgs e)
{
throw new NotImplementedException();
}

private void Timer_Tick(object sender, EventArgs e)
{
foreach (Control control in flowLayoutPanel1.Controls)
{
control.BackColor = Color.FromArgb(rnd.Next(256), rnd.Next(256), rnd.Next(256));
}
}

private void Form1_SizeChanged(object sender, EventArgs e)
{
//this.Text = this.Size.ToString();
}


}
}
     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.