Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Trent Butler All Dead Example
//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 Player { public Player(bool d) { Dead = d; } public bool Dead{get;set;} public void Sup() { Console.WriteLine("sup i'm {0}",Dead.ToString()); } } public class Program { public static void Main(string[] args) { //allplayers alive List<Player> players1 = new List<Player>() { new Player(true), new Player(true), new Player(true), new Player(true), new Player(true), new Player(true), new Player(true), new Player(true), new Player(true), }; players1.ForEach(x => x.Sup()); bool allDead1 = true; players1.ForEach(x => allDead1 &= x.Dead); //Your code goes here Console.WriteLine("Hello, world! alldead???....=> {0}",allDead1); //at least one dead List<Player> players2 = new List<Player>() { new Player(true), new Player(true), new Player(true), new Player(true), new Player(false), new Player(true), new Player(true), new Player(true), new Player(true), }; players2.ForEach(x => x.Sup()); bool allDead2 = true; //set it to true for initialization b/c 0 would and against a 1 and give 0 players2.ForEach(x => allDead2 &= x.Dead); //Your code goes here Console.WriteLine("Hello, world! alldead???....=> {0}",allDead2); } } }
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
Gamez
Hello World Program
swapping
decimal to multiple binary
merge sort
obraek
FromBase64String
Count the number of capital letters, small letters, digits, spaces and special characters.
Print 1 to 100 without using loop
Interface fully qualified names
Please log in to post a comment.