Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Plt-D v.0.8.5
//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 static void Main(string[] args) { 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); //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) { 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) { //***************************** } 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 FghtStep() { } 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
Random number guessing game v1
My
Fibonacci Series
בדיקה כמה פעמים מערך אחד כלול במערך אחר
qwerty
ffsfsfsfsfsferwfehtyjrvgjb
comb sort
Found many section of times intersect.
asdfghjujyhtgrfed
Least Common Multiple of 2 or more numbers.