Advertisement
remote87

Dragon Era

Sep 10th, 2015
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.37 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace DragonEra
  8. {
  9.     class DragonEra
  10.     {
  11.         static void Main()
  12.         {
  13.             int dragonNum = 2;
  14.             int startEggsNum = dragonNum * 3;
  15.             int hatchLive = 0;
  16.             //int yearsInput = 5;
  17.             string yearType = "Normal";
  18.             int dragonAge = 1;
  19.             int newbornsYear = 0;
  20.             int newEggs = 0;
  21.             List<int> dragon1 = new List<int>();
  22.             List<int> dragon2 = new List<int>();
  23.             for (hatchLive = 0; hatchLive <= 3; hatchLive++)
  24.             {
  25.                 if ((dragonAge == 3) || (dragonAge == 4))
  26.                 {
  27.                     if (yearType == "Normal")
  28.                     {
  29.                         newEggs = dragonNum * 1;
  30.                         startEggsNum += newEggs;
  31.                     }
  32.                     if (yearType == "Bad")
  33.                     {
  34.                         continue;
  35.                     }
  36.                     if (yearType == "Good")
  37.                     {
  38.                         newEggs = dragonNum * 2;
  39.                         startEggsNum += newEggs;
  40.                     }
  41.                 }
  42.                 if (dragonAge == 6)
  43.                 {
  44.                     Console.WriteLine("One of your oldest dragons has died. No more eggs from him.");
  45.                     dragonNum--;
  46.                 }
  47.                 if ((newbornsYear == 2) && (yearType == "Normal"))
  48.                 {
  49.                     dragonNum *= 2;
  50.                     dragon1.Add(2);
  51.                     dragon2.Add(2);
  52.                 }
  53.                 if ((newbornsYear == 2) && (yearType == "Good"))
  54.                 {
  55.                     dragonNum *= 4;
  56.                     dragon1.Add(2);
  57.                     dragon1.Add(3);
  58.  
  59.                     dragon2.Add(2);
  60.                     dragon2.Add(3);
  61.                 }
  62.                 newbornsYear++;
  63.                 dragonAge++;
  64.             }
  65.             Console.WriteLine("Dragons alive: {0}.", dragonNum);
  66.             for (int i = 0; i < dragon1.Count; i++)
  67.             {
  68.                 Console.WriteLine(dragon1[i]);
  69.             }
  70.             for (int j = 0; j < dragon2.Count; j++)
  71.             {
  72.                 Console.WriteLine(dragon2[j]);
  73.             }
  74.         }
  75.     }
  76. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement