using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using BibliotekaTuringa;


namespace TuringWPF
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        Turing t;

        public MainWindow()
        {
            InitializeComponent();

            t = Turing.Load("taśma.txt", "program.txt");
            t.PolecenieWykonane += polecenieWykonane;
        }

        private void polecenieWykonane(object? sender, Turing.PolecenieWykonaneEventArgs e)
        {
            lb.Items.Add(e.ToString());
        }

        private void Button_Click(object sender, RoutedEventArgs e)
        {
            t.WykonajProgram();
            t.ZapiszStanMaszyny("wynik.txt");
        }
    }
}