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.
The structure of tests should be a top-level
describe
block, followed by anit
block for Fixed and random test respectively. Having assertions as an individualit
block can mess up the output panel with a ton of messages, hardening debugging process for solversAll functions and global variables should be declared
local
Reference solution can be removed and replaced with in-line random generation along the given input string
math.randomseed(os.time())
is missing in the random test'sit
block (currently it isdescribe
block)Random tests do not generate cases when there is no trailing
!
in the given stringIdentation should be unified and cleaned up
it
block messages should be useful assertion messages (with the inclusion of quotes surrounding the input string)Kindly refer to the docs on how to write a good translation. Also you may be interested in this translation as a reference in future
The structure of tests should be a top-level
describe
block, followed by anit
block for Fixed and random test respectively. Having assertions as an individualit
block can mess up the output panel with a ton of messages, hardening debugging process for solversAll functions should be declared
local
math.randomseed(os.time())
is missing in the random test'sit
block (currently it isdescribe
block)Too many unnecessary tests, it can be simplified to 100 tests, with half of them having
a == b
and the other half randomly generated. (Kindly refer to C / Ruby translation for that)Reference solution can be removed and be generated concurrently as the given inputs
Identation should be unified and cleaned up
Kindly refer to the docs on how to write a good translation. Also you may be interested in this translation as a reference in future
The structure of tests should be a top-level
describe
block, followed by anit
block for Fixed and random test respectively. Having assertions as an individualit
block can mess up the output panel with a ton of messages, hardening debugging process for solversAll functions should be declared
local
math.randomseed(os.time())
should be within the random test'sit
block (currently it isdescribe
block)local s = require 'solution'
is abit unclear. The parameter name of initial solution setup is alsos
, suggesting to change it tolocal cockroach_speed = require ('solution')
Sample tests do not compile due to a missing quote
Identation and unnecessary comments should be cleaned up and removed respectively
Kindly refer to the docs on how to write a good translation. Also you may be interested in this translation as a reference in future
whoops
initial solution setup:
def cannonball(theta,v)
should bedef cannonball(theta,v,h):
great minds think alike
damn we did exactly the same lol
Changed all cases of
test.assert_equals
totest.expect
, because i genuinely didnt know how to get rid of thatfalse should equal true
at the endWhen tests fail, assertion message could be slightly improved. The part "Expected True but got False" is superfluous and potentially confusing, and information about tolerance is missing. MAybe you could check if using
test.expect
with a fully customised assertion message, including input values, expected values, actual values, and tolerance, would give a cleaner feedback on failure?forgot to tick the resolve issue box whoops
so use normal brackets instead of square ones right? understood
issue resolved
A known number of values with entirely different meanings should be represented as a tuple, not an array or a list. Use appropriate datatypes!
Do not ask for rounded results. This is documented.