Run Code
|
API
|
Code Wall
|
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
Project Euler Problem 7
Beadando Simon Szabolcs 10/M
dsda
Naju Date Format Issue
dice roll
test
Create RFReader HardwareConfig
Interface
ASCII -> Braille ASCII
,