Notes
Notes - notes.io |
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 on_numara
{
public partial class Form1 : Form
{
int[] sayilar = new int[23];
int[] tahminler = new int[11];
public Form1()
{
InitializeComponent();
}
private void textBox2_TextChanged(object sender, EventArgs e)
{
}
private void checkedListBox1_SelectedIndexChanged(object sender, EventArgs e)
{
}
private void panel1_Paint(object sender, PaintEventArgs e)
{
}
private void textBox1_TextChanged(object sender, EventArgs e)
{
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
int carrier;
int tah1, tah2, tah3, tah4, tah5, tah6, tah7, tah8, tah9, tah10;
int sayac=0;
string sayacstr;
tah1 = Int32.Parse(thmn1.Text);
tah2 = Int32.Parse(thmn2.Text);
tah3 = Int32.Parse(thmn3.Text);
tah4 = Int32.Parse(thmn4.Text);
tah5 = Int32.Parse(thmn5.Text);
tah6 = Int32.Parse(thmn6.Text);
tah7 = Int32.Parse(thmn7.Text);
tah8 = Int32.Parse(thmn8.Text);
tah9 = Int32.Parse(thmn9.Text);
tah10 = Int32.Parse(thmn10.Text);
if (thmn1.Text == "" || tah1>80)
{
MessageBox.Show("Lütfen 1.Tahmin'i 1 ile 80 arasında bir sayı giriniz");
thmn1.Focus();
}
else if (thmn2.Text == "" || tah2>80)
{
MessageBox.Show("Lütfen 2.Tahmin'i 1 ile 80 arasında bir sayı giriniz");
thmn2.Focus();
}
else if (thmn3.Text == "" || tah3>80)
{
MessageBox.Show("Lütfen 3.Tahmin'i 1 ile 80 arasında bir sayı giriniz");
thmn3.Focus();
}
else if (thmn4.Text == "" || tah4>80)
{
MessageBox.Show("Lütfen 4.Tahmin'i 1 ile 80 arasında bir sayı giriniz");
thmn4.Focus();
}
else if (thmn5.Text == "" || tah5>80)
{
MessageBox.Show("Lütfen 5.Tahmin'i 1 ile 80 arasında bir sayı giriniz");
thmn5.Focus();
}
else if (thmn6.Text == "" || tah6>80)
{
MessageBox.Show("Lütfen 6.Tahmin'i 1 ile 80 arasında bir sayı giriniz");
thmn6.Focus();
}
else if (thmn7.Text == "" || tah7>80)
{
MessageBox.Show("Lütfen 7.Tahmin'i 1 ile 80 arasında bir sayı giriniz");
thmn7.Focus();
}
else if (thmn8.Text == "" || tah8>80)
{
MessageBox.Show("Lütfen 8.Tahmin'i 1 ile 80 arasında bir sayı giriniz");
thmn8.Focus();
}
else if (thmn9.Text == "" || tah9>80)
{
MessageBox.Show("Lütfen 9.Tahmin'i 1 ile 80 arasında bir sayı giriniz");
thmn9.Focus();
}
else if (thmn10.Text == "" || tah10>80)
{
MessageBox.Show("Lütfen 10.Tahmin'i 1 ile 80 arasında bir sayı giriniz");
thmn10.Focus();
}
tahminler[0] = (tah1 = Int32.Parse(thmn1.Text));
tahminler[1] = (tah2 = Int32.Parse(thmn2.Text));
tahminler[2] = (tah3 = Int32.Parse(thmn3.Text));
tahminler[3] = (tah4 = Int32.Parse(thmn4.Text));
tahminler[4] = (tah5 = Int32.Parse(thmn5.Text));
tahminler[5] = (tah6 = Int32.Parse(thmn6.Text));
tahminler[6] = (tah7 = Int32.Parse(thmn7.Text));
tahminler[7] = (tah8 = Int32.Parse(thmn8.Text));
tahminler[8] = (tah9 = Int32.Parse(thmn9.Text));
tahminler[9] = (tah10 = Int32.Parse(thmn10.Text));
if (thmn10.Text != "")
{
if (tah1 < 81 && tah2 < 81 && tah3 < 81 && tah4 < 81 && tah5 < 81 && tah6 < 81 && tah7 < 81 && tah8 < 81 && tah9 < 81 && tah10 < 81)
{
Random r = new Random();
for (int i = 0; i < 22; i++)
{
sayilar[i] = r.Next(1, 81);
for (int j = 0; j < i; j++)
if (sayilar[j] == sayilar[i])
i--;
}
for (int i = 1; i < 22; i++)
for (int j = 0; j < 21; j++)
if (sayilar[j] > sayilar[j + 1])
{
carrier = sayilar[j];
sayilar[j] = sayilar[j + 1];
sayilar[j + 1] = carrier;
}
rnd1.Text = sayilar[0].ToString();
rnd2.Text = sayilar[1].ToString();
rnd3.Text = sayilar[2].ToString();
rnd4.Text = sayilar[3].ToString();
rnd5.Text = sayilar[4].ToString();
rnd6.Text = sayilar[5].ToString();
rnd7.Text = sayilar[6].ToString();
rnd8.Text = sayilar[7].ToString();
rnd9.Text = sayilar[8].ToString();
rnd10.Text = sayilar[9].ToString();
rnd11.Text = sayilar[10].ToString();
rnd12.Text = sayilar[11].ToString();
rnd13.Text = sayilar[12].ToString();
rnd14.Text = sayilar[13].ToString();
rnd15.Text = sayilar[14].ToString();
rnd16.Text = sayilar[15].ToString();
rnd17.Text = sayilar[16].ToString();
rnd18.Text = sayilar[17].ToString();
rnd19.Text = sayilar[18].ToString();
rnd20.Text = sayilar[19].ToString();
rnd21.Text = sayilar[20].ToString();
rnd22.Text = sayilar[21].ToString();
for (int i = 0; i < 10; i++)
for (int j = 0; j < 22; j++)
if (tahminler[i] == sayilar[j])
sayac++;
sayacstr = sayac.ToString() + " tane doğruyla ikramiye kazandınız";
if (sayac == 10 || sayac == 9 || sayac == 8 || sayac == 7 || sayac == 6 || sayac == 0)
MessageBox.Show(sayacstr, "On Numara Sonuç");
}
if (tah1 < 81 && tah2 < 81 && tah3 < 81 && tah4 < 81 && tah5 < 81 && tah6 < 81 && tah7 < 81 && tah8 < 81 && tah9 < 81 && tah10 < 81)
{
thmn1.Text = "";
thmn2.Text = "";
thmn3.Text = "";
thmn4.Text = "";
thmn5.Text = "";
thmn6.Text = "";
thmn7.Text = "";
thmn8.Text = "";
thmn9.Text = "";
thmn10.Text = "";
}
}
}
private void checkedListBox1_SelectedIndexChanged_1(object sender, EventArgs e)
{
}
private void thmn6_TextChanged(object sender, EventArgs e)
{
}
private void groupBox1_Enter(object sender, EventArgs e)
{
}
private void thmn10_TextChanged(object sender, EventArgs e)
{
}
}
}
|
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