Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.IO;
- namespace horsing_html
- {
- class Program
- {
- public class horse
- {
- public string Name = "";
- public int Tier = 0;
- public int Speed = 0;
- public int Health = 0;
- public int Stamina = 0;
- public int r = 0;
- public int y = 0;
- public int b = 0;
- }
- public static void CreateTab(horse myHorse)
- {
- List<string> displayInfo = new List<string> { };
- if (SkipFirst == false) { SkipFirst = true; } else { displayInfo.Add("<hr style=\"border: 2px solid#5b9aa0; margin:0px\" />"); }
- displayInfo.Add("<div class=\"grid-container\" style=\" width: auto; margin: 30 padding-bottom:0\">");
- displayInfo.Add("<div>" + myHorse.Name + "</div>");
- displayInfo.Add("<div>" + myHorse.Tier + "</div>");
- displayInfo.Add("<div>" + myHorse.Speed + "</div>");
- displayInfo.Add("<div>" + myHorse.Stamina + "</div>");
- displayInfo.Add("<div>" + myHorse.Health + "</div>");
- displayInfo.Add("<div>" + myHorse.r + "</div>");
- displayInfo.Add("<div>" + myHorse.y + "</div>");
- displayInfo.Add("<div>" + myHorse.b + "</div>");
- displayInfo.Add("</div>");
- lines.AddRange(displayInfo);
- }
- public static bool ValidNumberField(int min, int max,string readInfo)
- {
- try {
- int num = Convert.ToInt32(readInfo);
- if (num >= min & num <= max) { return true; }
- } catch { }
- return false;
- }
- public static List<string> lines = File.ReadAllLines("style.txt").ToList();
- public static bool SkipFirst = false;
- static void Main(string[] args)
- {
- Console.WriteLine("");
- Console.WriteLine("");
- Console.WriteLine("");
- Console.WriteLine("");
- Console.WriteLine(" Welcome to the BDO asset display");
- Console.WriteLine(" Hit {ENTER} To Get Started");
- Console.ReadLine();
- Console.Clear();
- List<horse> listHorse = new List<horse> { };
- while (true)
- {
- horse myHorse = new horse();
- Console.Clear();
- while (true)
- {
- Console.Write("Nickname (Must be 3 letters) - ");
- myHorse.Name = Console.ReadLine();
- Console.Clear();
- if (myHorse.Name.Length == 3) { break; }
- }
- while (true)
- {
- Console.Write("Tier (0-9) - ");
- string input = Console.ReadLine();
- Console.Clear();
- if (ValidNumberField(0, 9, input))
- {
- myHorse.Tier = Convert.ToInt32(input);
- break;
- }
- }
- while (true)
- {
- Console.Write("Speed (100-150) - ");
- string input = Console.ReadLine();
- Console.Clear();
- if (ValidNumberField(100, 150, input))
- {
- myHorse.Speed = Convert.ToInt32(input);
- break;
- }
- }
- while (true)
- {
- Console.Write("Health (1000-2000) - ");
- string input = Console.ReadLine();
- Console.Clear();
- if (ValidNumberField(0, 2000, input))
- {
- myHorse.Health = Convert.ToInt32(input);
- break;
- }
- }
- while (true)
- {
- Console.Write("Stamina (1000-4000) - ");
- string input = Console.ReadLine();
- Console.Clear();
- if (ValidNumberField(0, 4000, input))
- {
- myHorse.Stamina = Convert.ToInt32(input);
- break;
- }
- }
- while (true)
- {
- Console.Write("r (0-8) - ");
- string input = Console.ReadLine();
- Console.Clear();
- if (ValidNumberField(0, 8, input))
- {
- myHorse.Tier = Convert.ToInt32(input);
- break;
- }
- }
- while (true)
- {
- Console.Write("y (0-8) - ");
- string input = Console.ReadLine();
- Console.Clear();
- if (ValidNumberField(0, 8, input))
- {
- myHorse.y = Convert.ToInt32(input);
- break;
- }
- }
- while (true)
- {
- Console.Write("b (0-8) - ");
- string input = Console.ReadLine();
- Console.Clear();
- if (ValidNumberField(0, 8, input))
- {
- myHorse.b = Convert.ToInt32(input);
- break;
- }
- }
- listHorse.Add(myHorse);
- Console.Write("Create Another? (y/n) ");
- if (Console.ReadLine() == "n") { break; }
- Console.Clear();
- }
- foreach(horse h in listHorse)
- {
- CreateTab(h);
- }
- lines.Add("<div/>");
- File.WriteAllLines("index.html", lines);
- System.Diagnostics.Process.Start("index.html");
- Console.ReadLine();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement