CSharp Coding Problem! I am stumped!

Ok so i got this CSharp coding problem put to me and it has me absolutely stumped, it has to do with interfaces and cards, here is the skeleton code which i must alter:

public interface ICard { }

public interface IPackCards : IReadOnlyCollection<ICard> {

void Shuffle ();

ICard TakeCardFromTopOfPack ();

}

public interface IPackCardsCreator {

IPackCards Create ();

}

public class PackCardsCreator : IPackCardsCreator

{

public IPackCards Create() {

throw new NotImplementedException();

}

}

Problem: Please finish the implementation of PackOfCardsCreator and create implementations of IPackOfCards and ICard. The PackOfCardsCreator should create a standard pack of cards. This should be made up of 52 cards, with 4 different suits (Clubs, Hearts, Spades and Diamonds) and numbered 2, 3, 4, 5, 6, 7, 8, 9, 10, Jack, Queen, King, and Ace. You are free to do this however you like. IPackOfCards.Shuffle() should rearrange the cards in a random order. Repeated shuffles should not all return the cards in the same order. IPackOfCards.TakeCardFromTopOfPack() should return and remove the first card from cards in the pack.

by AbsoluteLove via /r/csharp

Leave a Reply