Facebook
From Ample Baboon, 5 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 184
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows.Forms;
  10.  
  11. namespace WindowsFormsApp5
  12. {
  13.     public partial class Form1 : Form
  14.     {
  15.         int i=1;
  16.         bool Answer = false;
  17.         int happy, sad, indifferent;
  18.  
  19.         public Form1()
  20.         {
  21.             InitializeComponent();
  22.         }
  23.  
  24.         private void label2_Click(object sender, EventArgs e)
  25.         {
  26.        
  27.         }
  28.  
  29.         private void label1_Click(object sender, EventArgs e)
  30.         {
  31.  
  32.         }
  33.  
  34.         private void Next1_Click(object sender, EventArgs e)
  35.         {
  36.  
  37.  
  38.             i++;
  39.  
  40.             if(i==2)
  41.             {
  42.                 if (Answer)
  43.                 {
  44.                     sad+=2;
  45.                     indifferent++;
  46.                 }
  47.                 else
  48.                 {
  49.                     happy++;
  50.                 }
  51.  
  52.                 NumberOfQuestion.Text = "Pytanie 2/5";
  53.                 Question.Text = "Czy jesteś uśmiechnięty?";
  54.             }
  55.             if(i==3)
  56.             {
  57.                 if (Answer)
  58.                 {
  59.                     happy++;
  60.                 }
  61.                 else
  62.                 {
  63.                     indifferent+=2;
  64.                     sad++;
  65.                 }
  66.  
  67.                 NumberOfQuestion.Text = "Pytanie 3/5";
  68.                 Question.Text = "Czy w ostatnich dniach przydarzyło Ci się coś niesamowitego?";
  69.             }
  70.             if (i == 4)
  71.             {
  72.                 if (Answer)
  73.                 {
  74.                     happy+=3;
  75.                 }
  76.                 else
  77.                 {
  78.                     indifferent++;
  79.                     sad++;
  80.                 }
  81.  
  82.                 NumberOfQuestion.Text = "Pytanie 4/5";
  83.                 Question.Text = "Czy w ostatnich dniach uprawiałeś sport?";
  84.             }
  85.             if (i == 5)
  86.             {
  87.                 if (Answer)
  88.                 {
  89.                     happy+=2;
  90.                 }
  91.                 else
  92.                 {
  93.                     indifferent+=2;
  94.                     sad ++;
  95.                 }
  96.  
  97.                 NumberOfQuestion.Text = "Pytanie 5/5";
  98.                 Question.Text = "Czy w ostantich dniach  przydarzyło Ci się coś smutnego?";
  99.                 NextButton.Text = "Podsumowanie";
  100.             }
  101.             if(i==6)
  102.             {
  103.                 if (Answer == true)
  104.                 {
  105.                     sad += 5;
  106.                 }
  107.                 else
  108.                 {
  109.                     indifferent+=2;
  110.                     sad++;
  111.                 }
  112.  
  113.                 if(sad>happy&&sad>indifferent)
  114.                 {
  115.                     NumberOfQuestion.Text = "Jesteś smutny! :(";
  116.                     Question.Visible = false;
  117.                     ButtonNie1.Visible = false;
  118.                     ButtonTak1.Visible = false;
  119.  
  120.                 }
  121.                 else if(happy>sad&&happy>indifferent)
  122.                 {
  123.                     NumberOfQuestion.Text = "Jesteś wesoły! :)";
  124.                     Question.Visible = false;
  125.                     ButtonNie1.Visible = false;
  126.                     ButtonTak1.Visible = false;
  127.                 }
  128.                 else if(indifferent>happy&& indifferent>sad)
  129.                 {
  130.                     NumberOfQuestion.Text = "Jesteś obojętny :|";
  131.                     Question.Visible = false;
  132.                     ButtonNie1.Visible = false;
  133.                     ButtonTak1.Visible = false;
  134.                 }
  135.             }
  136.         }
  137.  
  138.         private void ButtonTak1_CheckedChanged(object sender, EventArgs e)
  139.         {
  140.             Answer=true;
  141.         }
  142.  
  143.         private void ButtonNie1_CheckedChanged(object sender, EventArgs e)
  144.         {
  145.             Answer = false;
  146.  
  147.         }
  148.     }
  149. }
  150.