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 WhoAmI
{
    public partial class Form1 : Form
    {
        private List<Image> sampleImages;
        private List<Image> images;
        public Form1()
        {
            InitializeComponent();
            InitImages();
            SetRandomImage();
        }

        private void InitImages()
        {
            sampleImages = new List<Image>();
            sampleImages.Add(Properties.Resources.AbL);
            sampleImages.Add(Properties.Resources.jn);
            sampleImages.Add(Properties.Resources.sjp);

            images = new List<Image>();
            images.Add(Properties.Resources.lsk);
            images.Add(Properties.Resources.jjh);
            images.Add(Properties.Resources.jhw);
            images.Add(Properties.Resources.psq);
            images.Add(Properties.Resources.yjm);
            images.Add(Properties.Resources.ljs);
            images.Add(Properties.Resources.jjh);
        }

        private void SetRandomImage()
        {
            Random random = new Random((int)DateTime.Now.Ticks);
            int idx1 = random.Next() % sampleImages.Count;
            int idx2 = random.Next() % images.Count;
            int idx3;
            int idx4;
            do
            {
                idx3 = random.Next() % images.Count;
            }
            while (idx2 == idx3);
            do
            {
                idx4 = random.Next() % images.Count;
            }
            while (idx2 == idx4 | idx3 == idx4);

            mosicTiles1.Image = sampleImages[idx1];
            mosicTiles2.Image = images[idx2];
            mosicTiles3.Image = images[idx3];
            mosicTiles4.Image = images[idx4];
        }

    }
}
