Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Plt-D v.0.9.1
//Rextester.Program.Main is the entry point for your code. Don't change it. //Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5 using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; namespace Rextester { public class Plts { public int iD; public string name; public int xCord; public float numberBlts; public int reproductionBlts; public string color; } public class Program { bool WBlue = false; int count = 0; public int count12 = 0; public float percK = 1.1f; public static void Main(string[] args) { public float blueKD = 1.1f; string pl1 = "blue"; string pl2 = "red"; string pl3 = "green"; string pl100 = "gray"; Program classProg = new Program(); List<Plts> listPlts = new List<Plts>(); listPlts.Add(new Plts { iD = 1, name = "HRed", xCord = 4, numberBlts = 10f, reproductionBlts = 2, color = pl2 }); listPlts.Add(new Plts { iD = 2, name = "HBlue", xCord = 12, numberBlts = 10f, reproductionBlts = 2, color = pl1 }); listPlts.Add(new Plts { iD = 3, name = "net1", xCord = 11, numberBlts = 20f, reproductionBlts = 1, color = pl100 }); listPlts.Add(new Plts { iD = 4, name = "net2", xCord = 5, numberBlts = 5f, reproductionBlts = 1, color = pl100 }); listPlts.Add(new Plts { iD = 5, name = "net3", xCord = 8, numberBlts = 30f, reproductionBlts = 1, color = pl100 }); Console.WriteLine("Основа start: "); foreach (Plts llistPlst in listPlts) { Console.Write(" | " + llistPlst.name + " и " + llistPlst.numberBlts + " и " + llistPlst.color); } var tempColor = listPlts.First().color; while (classProg.WBlue != true) { classProg.BPlrs(pl1 ,listPlts, blueKD); //classProg.NetPlrs(listPlts); classProg.Count1(); } ; Console.WriteLine("\nОснова2:"); foreach (Plts llistPlst in listPlts) Console.Write(" | " + llistPlst.name + " и " + llistPlst.numberBlts + " и " + llistPlst.color); Console.WriteLine(" \ncount = " + classProg.count + " count12 = " + classProg.count12); } public void Count1() { count12++; } public void BPlrs(string stringColorPlr, List<Plts> lb, float KD) { Console.WriteLine("\n\n Blue \n"); if (count >=10) { WBlue = true; } else { string str = "blue"; var lBluePlts = SelfColor(stringColorPlr, lb); var lBlueAtk = SelfAtak(stringColorPlr, lb); Console.WriteLine ("lBlueAtk = " + lBlueAtk); // TODO: Blue Plts CalcBlts(str, lBluePlts); foreach (Plts lBP in lBluePlts) { Console.Write("\n 2 | " + lBP.name + " и " + lBP.numberBlts); } foreach (Plts BAtk in lBlueAtk) { //***************************** } ChsTrgt(lBluePlts,lBlueAtk); Console.WriteLine("\n count++ = " + count++); Console.WriteLine(" "); } } public void CalcBlts( string locColorString, IEnumerable<Plts> lb) { foreach (Plts l in lb) { Console.WriteLine (" |- " + l.numberBlts); l.numberBlts += l.reproductionBlts; } } public void ChsTrgt(IEnumerable<Plts> lb, IEnumerable<Plts> eLb) { float totalSummBlts = 0; float totalSummEBlts = 0; float percForDf = 0; int tempEBlts = 0; foreach (Plts l in eLb) { totalSummEBlts += l.numberBlts; } foreach (Plts l in lb) { totalSummBlts += l.numberBlts } foreach (Plts eL in eLb) { eL. if (eL.) tempEBlts = } foreach (Plts l in lb) { foreach (Plts eL in eLb) { if (l.numberBlts > Math.Floor(eL.numberBlts * percK)) // Console.Write("\n" + l.numberBlts + " > " + eL.numberBlts + " ("+ Math.Round((eL.numberBlts * percK)) + ")" + " " + eL.name ); // Console.Write("\n {0} {1}", Math.Floor(eL.numberBlts * percK), (eL.numberBlts * percK)); } } } public void FtStep() { } public void NetPlrs(List<Plts> lnet) { string str = "gray"; var netPlts = from list in lnet where list.color == "gray" select list; Console.WriteLine("Gray"); foreach (Plts lNetList in netPlts) { System.Threading.Thread.Sleep(10); Console.Write(" |Net " + lNetList.name); } Console.WriteLine(" "); } public IEnumerable<Plts> SelfColor(string lStr, List<Plts> l) { var l1 = from list in l where list.color == lStr select list; return l1; } public IEnumerable<Plts> SelfAtak(string lStr, List<Plts> l) { var l1 = from list in l where list.color != lStr select list; return l1; } } }
run
|
edit
|
history
|
help
0
Game_snake
9
The Collatz Conjecture
Math 9.61
Boyer Moore String Search
Decimal separator diff
Calculator
Compare 2 int
hackton
Fibonacci Series