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.
Specified to use POST request parameter
"code"
but was not found inattempt
test. OK, it makes sense for the usual test, I use an if-else statement to catch if it'sNone
, but it's alwaysNone
. Great idea once again, but requires some fixingGreat kata idea! However, sometimes the code runs too slow and won't fit inside of the time limit. Try using a
For more documentation, refer to https://docs.codewars.com/languages/python/codewars-test/
I see that this is a series and is presumable building to something but I don't think having the
/reset
route really adds anything to the experience at this point. also the description of the return dict felt a little awkward if it were just given in the dict litteral form of{'toreturn':'whatireturned'}
I don't think you would be giving to much away.That being said I enjoyed it and I'm going to try to go through the rest of this series.
Test cases in Python would be better if they were factorized a bit more. Currently, there are many repetitions. It's easy to create a generic function
dotest
that does the job for all tests, fixed and random. That would lighten the tests page and would be much more readable. Something like:I found the description very confusing and only figured out what json post key I was supposed to use by looking at the test cases. I have provided a rewrite for the code descriptions below that will hopefully make this kata a bit more clear for future codwarriors:
Implement a flask webserver that runs on localhost:4000 for host:port respectively.
There should be two routes:
Your flask webserver's Flask.run() method should be called from the runner() method.
JS Translation Also to bump the kata (for Approval, maybe?)
Edit: Actually no, a complete rework of the description
The required return value of
/reset
route is grossly unspecified.The expected socket type is
SOCK_STREAM
, so there are no message boundaries and it's not clear how much data should be read. It's a stream, so a read operation may read an arbitrary amount of data. A client should know how much data to expect before it should stop reading.What is the point of testing
m < 0
?