Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
give us a hint
If you extend this Kata to allow for let's say 0 <= flats/sharps <= 25 and 100's of random tests, it would become more mature.
Mmmmh, correct. I always thought that the
@Test
methods were instance methods of the same instance, and not creating different instances for each method... How weird... :oBut the loop still stays more "DRY" and easier to maintain. ;)
closer, but still some problems. ;)
return null;
)Note: instead of designing different test methods for the fixed tests, you could:
@Parametrized
stuff and so on). But that's quite complex to set up correctly in java, so I'd avoid that for the moment, if I were you. ;)About the random tests: one single method with a loop inside:
public static Map<String, String> charAttribute(int score) {...
. This way, the user can use whatever he wants (for instance, why a linked hashmap? A simple hashmap is sufficient. But in either way, the returned type needs to be aMap
).testMap
method. Use aMap
for the argument.Ctrl+H -> replace: /\t/ -> with: ____ -> ALL
(4 spaces instaed of the underscores, ofc)If you have a problem with your code, mark a question instead of an issue.
You need to deal with floating point inaccuracy.