NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

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 tombalaoyunu
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
Random rnd = new Random();
int birinciKartRakamlari;
int ikinciKartRakamlari;
int ucuncuKartRakamlari;
int sayiIndex1 = 0;
int sayiIndex2 = 0;
int sayiIndex3 = 0;
List<int> birincikartList = new List<int>();
List<int> ikincikartList = new List<int>();
List<int> ucuncukartList = new List<int>();
int birinciOyuncuSilinenButonSayisi = 1;
int ikinciOyuncuSilinenButonSayisi = 1;
int ucuncuOyuncuSilinenButonSayisi = 1;



private void Form1_Load(object sender, EventArgs e)
{
do
{

birinciKartRakamlari = rnd.Next(1, 91);
if (birincikartList.IndexOf(birinciKartRakamlari) == -1)
{
birincikartList.Add(birinciKartRakamlari);
}
} while (birincikartList.Count != 15);

int x1 = 4;
int y1 = 0;

List<Button> butonlar1 = new List<Button>();

for (int i = 1; i <= 27; i++)
{
Button btn_birinciKart = new Button();
btn_birinciKart.Size = new Size(40, 40);
btn_birinciKart.Location = new Point(x1, y1);
butonlar1.Add(btn_birinciKart);

if (i % 2 == 1)
{
btn_birinciKart.Text = birincikartList[sayiIndex1].ToString();
sayiIndex1++;
}
pnl_birinciOyuncu.Controls.Add(btn_birinciKart);
x1 += 45;
if (i % 9 == 0)
{
x1 = 4;
y1 += 45;
}
if (i % 2 == 0)
{
btn_birinciKart.Text = "";
}

}
butonlar1[17].Text = birincikartList[14].ToString();


/////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////
////// İKİNCİ //////

List<Button> butonlar2 = new List<Button>();
do
{
ikinciKartRakamlari = rnd.Next(1, 91);
if (ikincikartList.IndexOf(ikinciKartRakamlari) == -1)
{
ikincikartList.Add(ikinciKartRakamlari);
}
} while (ikincikartList.Count != 15);
//Array.Sort(sayilar);

//foreach (int eleman in sayilar)
//{
// listBox1.Items.Add(eleman);
//}
int x2 = 4;
int y2 = 0;
for (int a = 1; a <= 27; a++)
{
Button btn_ikinciKart = new Button();
btn_ikinciKart.Size = new Size(40, 40);
btn_ikinciKart.Location = new Point(x2, y2);

butonlar2.Add(btn_ikinciKart);

if (a % 2 == 1)
{
btn_ikinciKart.Text = birincikartList[sayiIndex2].ToString();
sayiIndex2++;
}
pnl_ikinciOyuncu.Controls.Add(btn_ikinciKart);

x2 += 45;

if (a % 9 == 0)
{
x2 = 4;
y2 += 45;
}
if (a % 2 == 0)
{
btn_ikinciKart.Text = "";
}
}
butonlar2[17].Text = ikincikartList[14].ToString();

/////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////
/////// ÜÇÜNCÜ //////

List<Button> butonlar3 = new List<Button>();

do
{
ucuncuKartRakamlari = rnd.Next(1, 91);
if (ucuncukartList.IndexOf(ucuncuKartRakamlari) == -1)
{
ucuncukartList.Add(ucuncuKartRakamlari);
}
} while (ucuncukartList.Count != 15);

int x3 = 4;
int y3 = 0;
for (int k = 1; k <= 27; k++)
{
Button btn_ucuncuKart = new Button();
btn_ucuncuKart.Size = new Size(40, 40);
btn_ucuncuKart.Location = new Point(x3, y3);
butonlar3.Add(btn_ucuncuKart);

if (k % 2 == 1)
{
btn_ucuncuKart.Text = ucuncukartList[sayiIndex3].ToString();
sayiIndex3++;
}
pnl_ucuncuOyuncu.Controls.Add(btn_ucuncuKart);

x3 += 45;

if (k % 9 == 0)
{
x3 = 4;
y3 += 45;
}
if (k % 2 == 0)
{
btn_ucuncuKart.Text = "";
}
}
butonlar3[17].Text = ucuncukartList[14].ToString();
}

private void btn_sayiCek_Click(object sender, EventArgs e)
{
int rastgelesayi;
List<int> cekilenSayi = new List<int>();
do
{
rastgelesayi = rnd.Next(1, 91);
if (cekilenSayi.IndexOf(rastgelesayi) == -1)
{
cekilenSayi.Add(rastgelesayi);
txt_cekilenSayi.Text = rastgelesayi.ToString();
}
} while (cekilenSayi.Count != 81);

foreach (Control buTon in pnl_birinciOyuncu.Controls)
{
if (buTon.Text == rastgelesayi.ToString())
{
buTon.BackColor = Color.Black;
lbl_birinciOyuncuSilme.Text = birinciOyuncuSilinenButonSayisi.ToString();
birinciOyuncuSilinenButonSayisi++;
}

}

foreach (Control buTon in pnl_ikinciOyuncu.Controls)
{
if (buTon.Text == rastgelesayi.ToString())
{
buTon.BackColor = Color.Black;
lbl_ikinciOyuncuSilme.Text = ikinciOyuncuSilinenButonSayisi.ToString();
ikinciOyuncuSilinenButonSayisi++;
}
}

foreach (Control buTon in pnl_ucuncuOyuncu.Controls)
{
if (buTon.Text == rastgelesayi.ToString())
{
buTon.BackColor = Color.Black;
lbl_ucuncuOyuncuSilme.Text = ucuncuOyuncuSilinenButonSayisi.ToString();
ucuncuOyuncuSilinenButonSayisi++;
}
}



}
}
}
     
 
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.