Beispiel #1
0
        public vjezba()
        {
            InitializeComponent();
            //Baza.init();
            //Baza.callsPreBase();
            Sentence.rjecnik = Baza.get();

            //Baza.DBOperation("SELECT * FROM STANJA_R", true);
            question     = Baza.getNextLetter(type);
            pitanje.Text = question;

            Grid.SetRow(L, 3);
            Grid.SetRowSpan(L, 2);
            Grid.SetColumn(L, 4);

            Grid.SetRow(L2, 3);
            Grid.SetRowSpan(L2, 2);
            Grid.SetColumn(L2, 3);

            g1.Children.Add(L);
            g1.Children.Add(L2);



            //update(1, false);
        }
Beispiel #2
0
        private void dalje_Click(object sender, RoutedEventArgs e)
        {
            List <Letter> slova = new List <Letter>();

            if (!L.isEmpty())
            {
                slova.Add(new Letter(L.getMask()));
            }
            if (!L2.isEmpty())
            {
                slova.Add(new Letter(L2.getMask()));
            }
            //MessageBox.Show(L.isEmpty() + " " + L2.isEmpty());
            if (type == 2)
            {
                slova.Reverse();
            }

            Sentence solution = new Sentence(slova, type);

            MessageBox.Show("p" + solution.ToString() + "p" + question + "p");
            string Ssolution = solution.ToString();

            if (Ssolution == question)
            {
                Baza.updateLetterState(question, 1, type);
                question           = Baza.getNextLetter(type);
                pitanje.Text       = question;
                border.BorderBrush = Brushes.ForestGreen;
                obrisi();
            }
            else
            {
                Baza.updateLetterState(question, 0, type);
                border.BorderBrush = Brushes.Red;
                obrisi();
            }
        }