using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace bootcamp
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
/*
1 = Pushups
2 = Jumping Jacks
3 = Situps
4 = Squats
5 = Burpees
*/
Random random = new Random();
int GetAmount(int type)
{
int raw_mod = random.Next(10, 15);
int mod = raw_mod / 10;
if (type == 1) // Pushups
{
return random.Next(5, 16) * mod;
}
else if (type == 2) // Jumping jacks
{
return random.Next(15, 26) * mod;
}
else if (type == 3) // Situps
{
return random.Next(10, 21) * mod;
}
else if (type == 4) // Squats
{
return random.Next(15, 21) * mod;
}
else if (type == 5) // Burpees
{
return random.Next(10, 26) * mod;
}
return 15 * mod;
}
string GetName(int type)
{
if (type == 1) // Pushups
{
return "push-ups";
}
else if (type == 2) // Jumping jacks
{
return "jumping jacks";
}
else if (type == 3) // Situps
{
return "sit-ups";
}
else if (type == 4) // Squats
{
return "squats";
}
else if (type == 5) // Burpees
{
return "burpees";
}
return "ERROR";
}
private void level_Scroll(object sender, EventArgs e)
{
int lvl = level.Value;
if (lvl == 1)
{
levellabel.Text = "Level: Private";
}
else if (lvl == 2)
{
levellabel.Text = "Level: Colonel";
}
else if (lvl == 3)
{
levellabel.Text = "Level: General";
}
}
private void Form1_Load(object sender, EventArgs e)
{
// Do nothing
}
private void roll_Click(object sender, EventArgs e)
{
tasks.Items.Clear();
int tasks_amount = random.Next(4, 7);
for (int i = 0; i < tasks_amount + 1; i++)
{
if (i != tasks_amount)
{
int type = random.Next(1, 6);
int amount = GetAmount(type) * level.Value;
string display = "Do " + Convert.ToString(amount) + " " + GetName(type) + ".";
tasks.Items.Add(display);
}
else
{
tasks.Items.Add("Go home, soldier.");
}
}
}
}
}