quote: "Mom said never to use an Ak-47 against the fish man!"
BastardDomain Forums \ Fun \ wc teksten
wc teksten
Gorgeous George
Opmerk Bastard

Registered: 13 Jul 2001
Location: BehindMy21
Posts: 4748
5 Feb 2012

namespace ToiletApplication
{
class Program
{
static void Main(string[] args)
{
var person = new Person() { Name = "YOU" };
var toilet = new Toilet();
var toiletBrush = new ToiletBrush();

person.Poop(toilet);
person.CleanToilet(toilet, toiletBrush);

Console.WriteLine(person.Name + " has done a good job cleaning after yourself"smilie;
Console.ReadLine();
}
}

public class Person
{
public string Name { get; set; }

public void Poop(Toilet toilet)
{
toilet.Use();
}

internal void CleanToilet(Toilet toilet, ToiletBrush toiletBrush)
{
while (!toilet.isClean())
{
toiletBrush.Clean(toilet);
}
}
}

public class Toilet
{
int nrOfBrownSpots = 0;

public void Use()
{
Random r = new Random(DateTime.Now.Millisecond);
nrOfBrownSpots = r.Next(1, 10);
}

public bool isClean()
{
return nrOfBrownSpots == 0;
}

internal void RemoveBrownSpot()
{
nrOfBrownSpots--;
Console.WriteLine(nrOfBrownSpots);
}
}

public class ToiletBrush
{
public void Clean(Toilet toilet)
{
toilet.RemoveBrownSpot();
}
}
}

This post was edited by Gorgeous George at 5 Feb 2012

Gorgeous George
Opmerk Bastard

Registered: 13 Jul 2001
Location: BehindMy21
Posts: 4748
5 Feb 2012

hmmm met indentation is ie beter te lezen, oh wacht daar hebben we de [ code] tag voor

This post was edited by Gorgeous George at 5 Feb 2012

rens
Flying Bastard

avatar rens

Registered: 18 Oct 2002
Location: Behind-U
Posts: 1257
6 Feb 2012

LOL

"http($this->addslashes("http://rens.rednode.nl/Poo.png")) . "\" border=\"0\" alt=\"[user image]\" />"

This post was edited by rens at 6 Feb 2012


You want some, come get some!!!!!
 1 
© 2000 - 2024 BastardDomain.com