Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Xml;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- namespace Social_algorithim
- {
- public partial class Form1 : Form
- {
- int Animal = 50;
- int Tech = 50;
- Random Rand = new Random();
- bool Liked;
- string CurrentPic = "Animal";
- int CurrentRand;
- Image Animal1Pic = Image.FromFile(@"C:\Users\DotCD\Desktop\Algorithim\Animals\Animal1.png");
- Image Animal2Pic = Image.FromFile(@"C:\Users\DotCD\Desktop\Algorithim\Animals\Animal2.png");
- Image Animal3Pic = Image.FromFile(@"C:\Users\DotCD\Desktop\Algorithim\Animals\Animal3.png");
- Image Animal4Pic = Image.FromFile(@"C:\Users\DotCD\Desktop\Algorithim\Animals\Animal4.png");
- Image Animal5Pic = Image.FromFile(@"C:\Users\DotCD\Desktop\Algorithim\Animals\Animal5.png");
- Image Tech1Pic = Image.FromFile(@"C:\Users\DotCD\Desktop\Algorithim\Tech\Tech1.png");
- Image Tech2Pic = Image.FromFile(@"C:\Users\DotCD\Desktop\Algorithim\Tech\Tech2.png");
- Image Tech3Pic = Image.FromFile(@"C:\Users\DotCD\Desktop\Algorithim\Tech\Tech3.png");
- Image Tech4Pic = Image.FromFile(@"C:\Users\DotCD\Desktop\Algorithim\Tech\Tech4.png");
- Image Tech5Pic = Image.FromFile(@"C:\Users\DotCD\Desktop\Algorithim\Tech\Tech5.png");
- public Form1()
- {
- InitializeComponent();
- pictureBox1.Image = Animal1Pic;
- }
- private void Form1_Load(object sender, EventArgs e)
- {
- }
- //next button
- private void button1_Click(object sender, EventArgs e)
- {
- if (Liked == true)
- {
- if (CurrentPic == "Animal")
- {
- Animal = Animal + 5;
- Tech = Tech - 5;
- Liked = false;
- }
- if (CurrentPic == "Tech")
- {
- Tech = Tech + 5;
- Animal = Animal - 5;
- Liked = false;
- }
- }
- if (Tech < Animal)
- {
- CurrentRand = Rand.Next(1, 100);
- if (CurrentRand > Tech)
- {
- ShowAnimal();
- }
- if (CurrentRand < Tech)
- {
- ShowTech();
- }
- else
- {
- ShowAnimal();
- }
- }
- if (Tech > Animal)
- {
- CurrentRand = Rand.Next(1, 100);
- if (CurrentRand > Animal)
- {
- ShowTech();
- }
- if (CurrentRand < Animal)
- {
- ShowAnimal();
- }
- else
- {
- ShowTech();
- }
- }
- }
- //like button
- private void button2_Click(object sender, EventArgs e)
- {
- Liked = true;
- }
- private void ShowAnimal()
- {
- CurrentPic = "Animal";
- CurrentRand = Rand.Next(1, 5);
- if(CurrentRand == 1)
- {
- pictureBox1.Image = Animal1Pic;
- textBox1.Text = pictureBox1.Image.ToString();
- }
- if(CurrentRand == 2)
- {
- pictureBox1.Image = Animal2Pic;
- textBox1.Text = pictureBox1.Image.ToString();
- }
- if(CurrentRand == 3)
- {
- pictureBox1.Image = Animal3Pic;
- textBox1.Text = pictureBox1.Image.ToString();
- }
- if(CurrentRand == 4)
- {
- pictureBox1.Image = Animal4Pic;
- textBox1.Text = pictureBox1.Image.ToString();
- }
- if(CurrentRand == 5)
- {
- pictureBox1.Image = Animal5Pic;
- textBox1.Text = pictureBox1.Image.ToString();
- }
- }
- private void ShowTech()
- {
- CurrentPic = "Tech";
- CurrentRand = Rand.Next(1, 5);
- if (CurrentRand == 1)
- {
- pictureBox1.Image = Tech1Pic;
- textBox1.Text = pictureBox1.Image.ToString();
- }
- if (CurrentRand == 2)
- {
- pictureBox1.Image = Tech2Pic;
- textBox1.Text = pictureBox1.Image.ToString();
- }
- if (CurrentRand == 3)
- {
- pictureBox1.Image = Tech3Pic;
- textBox1.Text = pictureBox1.Image.ToString();
- }
- if (CurrentRand == 4)
- {
- pictureBox1.Image = Tech4Pic;
- textBox1.Text = pictureBox1.Image.ToString();
- }
- if (CurrentRand == 5)
- {
- pictureBox1.Image = Tech5Pic;
- textBox1.Text = pictureBox1.Image.ToString();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement