Пример #1
0
        private async void potez_protivnik1()
        {
            Red.Text = "Protivnik1 je na redu!";
            foreach (Control c in Controls)
            {
                if (c is TextBox)
                {
                    var tbx = (TextBox)c;
                    tbx.ReadOnly = true;
                }
            }
            int tezina = DetaljiIgre.TezinaPrvog(1);
            await Task.Delay(1500);

            if (neotvorena_polja().Count > 0)
            {
                otvori_random_polje();
                int i = stupac_s_najvise_otvorenih();
                await Task.Delay(1000);

                pogadaj_rjesenje_stupca(i, tezina, 1);
            }
            else if (neotvorena_rjesenja_stupaca().Count > 0)
            {
                int j = stupac_s_najvise_otvorenih();
                pogadaj_rjesenje_stupca(j, tezina, 1);
            }
            else
            {
                pogadaj_konacno_rjesenje(tezina, 1);
            }
        }
Пример #2
0
        public ABC()
        {
            InitializeComponent();
            this.StartPosition = FormStartPosition.Manual;
            this.Left          = 200;
            this.Top           = 80;

            progressBar1.Maximum = 4;
            progressBar1.Value   = 0;

            igra = new FileManager().abcPitalica();

            switch (DetaljiIgre.TezinaPrvog(0))
            {
            case 1: vjerojatnost1 = 40; break;

            case 2: vjerojatnost1 = 70; break;

            case 3: vjerojatnost1 = 90; break;
            }

            switch (DetaljiIgre.TezinaDrugog(0))
            {
            case 1: vjerojatnost2 = 40; break;

            case 2: vjerojatnost2 = 70; break;

            case 3: vjerojatnost2 = 90; break;
            }

            update_progress = new EventHandler(timer_update);
            kraj_pitanja    = new EventHandler(krajPitanja);

            timer.Enabled  = true;
            timer.Interval = 1000;
            timer.Tick    += update_progress;

            label_pitanje.Text = igra[5 * pitanje];
            a_radio.Text       = igra[5 * pitanje + 1];
            b_radio.Text       = igra[5 * pitanje + 2];
            c_radio.Text       = igra[5 * pitanje + 3];

            foreach (string s in igra)
            {
                Console.WriteLine(s);
            }

            timer.Start();
        }
Пример #3
0
        public SettingsForm()
        {
            InitializeComponent();
            prvi_abc.Value = DetaljiIgre.TezinaPrvog(0);
            prvi_as.Value  = DetaljiIgre.TezinaPrvog(1);
            prvi_det.Value = DetaljiIgre.TezinaPrvog(2);
            prvi_zav.Value = DetaljiIgre.TezinaPrvog(3);

            drugi_abc.Value    = DetaljiIgre.TezinaDrugog(0);
            drugi_as.Value     = DetaljiIgre.TezinaDrugog(1);
            drugi_det.Value    = DetaljiIgre.TezinaDrugog(2);
            drugi_zav.Value    = DetaljiIgre.TezinaDrugog(3);
            this.StartPosition = FormStartPosition.Manual;
            this.Left          = 200;
            this.Top           = 80;
        }
Пример #4
0
        public Zavrsna()
        {
            //KAD SE SPOJIS NA MASTER
            tocnost_drugog = DetaljiIgre.TezinaPrvog(3) * 0.25;
            tocnost_treceg = DetaljiIgre.TezinaDrugog(3) * 0.25;
            String[] zavrsna = new FileManager().zavrsna();
            pitanja   = new List <string>();
            tocni_odg = new List <string>();
            krivi_odg = new List <string>();

            for (int i = 0; i < zavrsna.Length; ++i)
            {
                pitanja.Add(zavrsna[i]);
                tocni_odg.Add(zavrsna[++i]);
                krivi_odg.Add(zavrsna[++i]);
                krivi_odg.Add(zavrsna[++i]);
                krivi_odg.Add(zavrsna[++i]);
            }

            bodovi   = 0;
            bodovi_2 = 0;
            bodovi_3 = 0;

            na_redu                 = 0;
            random                  = new Random();
            curr_q                  = 0;
            this.Width              = 1200;
            this.Height             = 800;
            this.FormBorderStyle    = FormBorderStyle.FixedSingle;
            kaj_se_dogada           = new Label();
            kaj_se_dogada.Size      = new Size(800, 100);
            kaj_se_dogada.Anchor    = AnchorStyles.Top;
            kaj_se_dogada.Location  = new Point((ClientRectangle.Width - kaj_se_dogada.Width) / 2, 0);
            kaj_se_dogada.Text      = "ZAVRŠNA IGRA";
            kaj_se_dogada.TextAlign = ContentAlignment.MiddleCenter;
            kaj_se_dogada.Font      = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
            this.Controls.Add(kaj_se_dogada);

            timer_label          = new Label();
            timer_label.Size     = new Size(80, 80);
            timer_label.Location = new Point((ClientRectangle.Width) / 2, 100);
            timer_label.Text     = "";
            this.Controls.Add(timer_label);

            taster           = new Button();
            taster.Text      = "Prijavi se!";
            taster.TextAlign = ContentAlignment.MiddleCenter;
            taster.Location  = new Point((ClientRectangle.Width - taster.Width) / 2, (ClientRectangle.Height - 200));
            taster.Enabled   = false;
            taster.Click    += prijavi_se;
            this.Controls.Add(taster);

            ind_tast1           = new Label();
            ind_tast1.BackColor = Color.IndianRed;
            ind_tast1.TextAlign = ContentAlignment.MiddleCenter;
            ind_tast1.Size      = new Size(200, 50);
            ind_tast1.Location  = new Point(taster.Location.X - 50, taster.Location.Y - 100);
            this.Controls.Add(ind_tast1);

            ind_tast2           = new Label();
            ind_tast2.TextAlign = ContentAlignment.MiddleCenter;
            ind_tast2.BackColor = Color.IndianRed;
            ind_tast2.Size      = new Size(200, 50);
            ind_tast2.Location  = new Point(300, 250);
            this.Controls.Add(ind_tast2);

            ind_tast3           = new Label();
            ind_tast3.BackColor = Color.IndianRed;
            ind_tast3.TextAlign = ContentAlignment.MiddleCenter;
            ind_tast3.Size      = new Size(200, 50);
            ind_tast3.Location  = new Point(700, 250);
            this.Controls.Add(ind_tast3);

            unesi_odg          = new TextBox();
            unesi_odg.Size     = new Size(200, 100);
            unesi_odg.Location = new Point((ClientRectangle.Width - unesi_odg.Width) / 2, (ClientRectangle.Height - unesi_odg.Height - 100));
            unesi_odg.Anchor   = AnchorStyles.Bottom;
            unesi_odg.Enabled  = false;
            unesi_odg.KeyDown += odg_key_down;
            this.Controls.Add(unesi_odg);

            next_q           = new Button();
            next_q.Text      = "Sljedeće pitanje";
            next_q.Size      = new Size(80, 80);
            next_q.TextAlign = ContentAlignment.MiddleCenter;
            next_q.Location  = new Point((ClientRectangle.Width - next_q.Width) / 2, (ClientRectangle.Height - 500));
            next_q.Click    += postavi_pitanje;
            this.Controls.Add(next_q);

            this.timer1       = new System.Windows.Forms.Timer();
            this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
            timer1.Interval   = 500;

            InitializeComponent();
            this.StartPosition = FormStartPosition.Manual;
            this.Left          = 200;
            this.Top           = 80;

            this.FormBorderStyle = FormBorderStyle.FixedSingle;
            this.FormClosing    += new FormClosingEventHandler(Zavrsna_FormClosing);
        }
Пример #5
0
        public Detekcija()
        {
            InitializeComponent();

            razina1 = DetaljiIgre.TezinaPrvog(2);
            razina2 = DetaljiIgre.TezinaDrugog(2);

            poredakIgraca = numbers.OrderBy(x => rnd.Next()).ToArray();

            //OBLIKOVANJE
            this.Width         = 1100;
            this.Height        = 700;
            this.StartPosition = FormStartPosition.Manual;
            this.Left          = 200;
            this.Top           = 80;

            trenutniIspitivac.Text     = "";
            trenutniIspitivac.Visible  = false;
            trenutniIspitivac.Location = new Point(50, 250);
            kojuOsobuPita.Text         = "";
            kojuOsobuPita.Location     = new Point(280, 250);
            kojuOsobuPita.Visible      = false;
            odgovorOsobe.Text          = "";
            odgovorOsobe.Location      = new Point(500, 250);
            odgovorOsobe.Visible       = false;
            odgovorOsobe.AutoSize      = false;
            odgovorOsobe.Width         = 500;
            odgovorOsobe.Height        = 80;

            glasajPrije.Visible  = false;
            glasajPrije.Location = new Point(760, 100);
            glasajPrije.Width    = 260;
            glasajPrije.Height   = 30;

            preskoci.Visible  = false;
            preskoci.Location = new Point(760, 50);
            preskoci.Width    = 260;
            preskoci.Height   = 30;

            //OBLAK S TEKSTOM
            label2.Width  = 305;
            label2.Height = 105;
            GraphicsPath gp = new GraphicsPath();

            gp.AddEllipse(0, 0, label2.Width, label2.Height);
            label2.Region = new Region(gp);
            label2.Invalidate();
            label2.Location = tekst1;
            label2.Visible  = false;

            //TRI KRUZICA!!!!
            label3.Width  = 40;
            label3.Height = 40;
            GraphicsPath gpp = new GraphicsPath();

            gpp.AddEllipse(0, 0, label3.Width, label3.Height);
            label3.Region = new Region(gpp);
            label3.Invalidate();
            label3.Text     = "";
            label3.Location = krug1_1;
            label3.Visible  = false;

            label4.Width  = 30;
            label4.Height = 30;
            GraphicsPath gppp = new GraphicsPath();

            gppp.AddEllipse(0, 0, label4.Width, label4.Height);
            label4.Region = new Region(gppp);
            label4.Invalidate();
            label4.Text     = "";
            label4.Location = krug2_1;
            label4.Visible  = false;

            label5.Width  = 20;
            label5.Height = 20;
            GraphicsPath gpppp = new GraphicsPath();

            gpppp.AddEllipse(0, 0, label5.Width, label5.Height);
            label5.Region = new Region(gpppp);
            label5.Invalidate();
            label5.Text     = "";
            label5.Location = krug3_1;
            label5.Visible  = false;

            listBox1.Width       = 520;
            listBox1.Height      = 300;
            listBox1.Location    = new Point(50, this.Bottom - 450);
            progressBar1.Maximum = 60;

            progressBar1.Width    = 400;
            progressBar1.Height   = 50;
            progressBar1.Location = new Point(620, this.Bottom - 215);

            pictureBox1.Width     = 120;
            pictureBox1.Height    = 200;
            pictureBox1.Location  = new Point(620, this.Bottom - 450);
            pictureBox1.BackColor = Color.Aqua;
            pictureBox1.SizeMode  = PictureBoxSizeMode.StretchImage;
            //pictureBox1.Image = new Bitmap(@"potrebno/musko.png");
            var file = @"potrebno/musko.png";

            using (var s = new System.IO.FileStream(file, System.IO.FileMode.Open))
            {
                pictureBox1.Image = Image.FromStream(s);
            }
            osoba1.Location = new Point(620, this.Bottom - 245);
            osoba1.Enabled  = false;
            osoba1.Width    = 120;
            osoba1.Height   = 25;

            pictureBox2.Width     = 120;
            pictureBox2.Height    = 200;
            pictureBox2.Location  = new Point(760, this.Bottom - 450);
            pictureBox2.BackColor = Color.Aqua;
            pictureBox2.SizeMode  = PictureBoxSizeMode.StretchImage;
            //pictureBox2.Image = new Bitmap(@"potrebno/musko.png");
            using (var s = new System.IO.FileStream(file, System.IO.FileMode.Open))
            {
                pictureBox2.Image = Image.FromStream(s);
            }
            osoba2.Location = new Point(760, this.Bottom - 245);
            osoba2.Width    = 120;
            osoba2.Enabled  = false;
            osoba2.Height   = 25;

            pictureBox3.Width     = 120;
            pictureBox3.Height    = 200;
            pictureBox3.Location  = new Point(900, this.Bottom - 450);
            pictureBox3.BackColor = Color.Aqua;
            pictureBox3.SizeMode  = PictureBoxSizeMode.StretchImage;
            pictureBox3.Image     = new Bitmap(@"potrebno/musko.png");
            osoba3.Location       = new Point(900, this.Bottom - 245);
            osoba3.Width          = 120;
            osoba3.Enabled        = false;
            osoba3.Height         = 25;

            naslov.Location  = new Point(50, 50);
            zapocni.Location = new Point(50, 100);

            label1.Location = new Point(50, 150);

            //Image myimage = new Bitmap(@"oblacic.png");
            //label2.Image = myimage;

            ime             = detekcija[0];
            pocetnaRecenica = detekcija[1];
            label1.Text     = "Osoba koju tražite je " + ime + ".";
            label2.Text     = pocetnaRecenica;
            for (int i = 0; i < 10; i++)
            {
                string          pitanje  = detekcija[2 + i * 4];
                string[]        odgovori = { detekcija[3 + i * 4], detekcija[4 + i * 4], detekcija[5 + i * 4] };
                PitanjaOdgovori dodaj    = new PitanjaOdgovori();
                dodaj.pitanje  = pitanje;
                dodaj.odgovori = odgovori;
                pitanjaOdgovori.Add(dodaj);
            }
            foreach (var item in pitanjaOdgovori)
            {
                listBox1.Items.Add(item.pitanje);
            }
            Random rand  = new Random();
            Random rand1 = new Random();

            urediOdgovoreIgraca(0, rand, rand1);
            urediOdgovoreIgraca(1, rand, rand1);
            urediOdgovoreIgraca(2, rand, rand1);

            //for (int i = 0; i < 10; i++)
            //    Console.Write(odgovoriOsobeA[i] + " ");
            //Console.WriteLine();
            //for (int i = 0; i < 10; i++)
            //    Console.Write(odgovoriOsobeB[i] + " ");
            //Console.WriteLine();
            //for (int i = 0; i < 10; i++)
            //    Console.Write(odgovoriOsobeC[i] + " ");
            //Console.WriteLine();
            //foreach (var item in vjerojatnosti)
            //{
            //    Console.Write(item.ToString() + " ");
            //}
            //Console.WriteLine();
            //foreach (var item in koji_vjerojatnosti)
            //{
            //    Console.Write(item.ToString() + " ");
            //}
            //Console.WriteLine();
        }