Darwin Theory
Description:
#Darwin Theory
The story of this Kata is similar to Darwin Theory.
There is a class named "Creature" and you are supposed to complete the class.
Any instance of this class is a creature.
Lets say:
Creature balineseCat = new Creature();
balineseCat is a cat that you have created and you are the True God.
You have to be able to assign your creature properties by use of indexer, for example:
balineseCat["Eye"]="Blue";
It is not the whole story yet.
Suppose you create a fish:
Creature fish= new Creature();
give it the ability to survive in water:
fish["gill"]=true;
Then you create a frog:
Creature frog= new Creature();
The frog can automatically survive in water, and you don't need to modify it further.
If you give him lung to breathe in air and drop the gill:
frog["lung"]=true;
frog["gill"]=false;
The next creature you will create can automatically breathe in air with the lung.
P.S. The properties that are assigned by indexers can be in any type.
Test cases clarify the problem.
Take a look at MSDN to get more help about indexers:
MSDN Link for Indexer
Similar Kata:
Stats:
Created | Dec 29, 2015 |
Published | Dec 30, 2015 |
Warriors Trained | 611 |
Total Skips | 162 |
Total Code Submissions | 404 |
Total Times Completed | 131 |
C# Completions | 131 |
Total Stars | 14 |
% of votes with a positive feedback rating | 84% of 37 |
Total "Very Satisfied" Votes | 27 |
Total "Somewhat Satisfied" Votes | 8 |
Total "Not Satisfied" Votes | 2 |
Total Rank Assessments | 6 |
Average Assessed Rank | 6 kyu |
Highest Assessed Rank | 4 kyu |
Lowest Assessed Rank | 7 kyu |