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.
😂 I feel the urge to put an api request to get the most accurate calculator to carry out this mathematical operations
Nice it is much longer now.
Thanks for your thoughts and ideas! The short answer is yes, it can be.
If you read the wiki article linked, you'll see a couple examples where you have more specific notation for variables with multiple subsets. For example,
arru8NumberList
is an array of unsigned 8-bit integers ("arru8"). The problem I found when trying to make more detailed implementation is that it either becomes very repetative, (e.g. one massive function with 50 if conditions) and the actual difficulty comes in writing tests for the function. I think ultimately, the actual fun and interesting part of the challenge is condensed into the code I've written.I've given it some more thought, and I think something that could be more fun would be setting up other conditions for the prefixes, and checking if the value inside of the variable meets the conditions for the given prefix.
That's a bad example for python, but the point is still the same. For a challenge like that, you'll still have to check the type() the way I was, but you'll have to actually use other logic to return True/False
Is this applicable for all the different types of data, including subsets of the same type (i.e. sets v.s. frozensets, bytes v.s. bytearray)? If not, I think that'd be a good way to add onto this and turn it into a kata, as well as maybe adding some new types in your test cases to add double-/triple-word typenames.
@JefeThePug: if you post code, better to fork the kumite.
HERE NOW
(built from seraph's original change to any type)
Well, declaring as a string forces any input to be formatted as a string, from what I can tell, so I just put an int as the test to make sure that the code runs for all possible inputs, including potential miscommunication with the script for "None" or "Null" jokes.
Good contribution! However, you declared the parameter
food_source
as astring
and later pass aninterger
as a value in the tests. Perhaps you should declarefood_source
asAny
if you want it to be "any" type of datatype?I just made the arguments forced strings, so you can put whatever you want in whatever slot.