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.
Approved
I created and approved a fork of your translation where I fixed a bug in random tests. It is necessary to perform 2 moves to get a correct string from a signed number in COBOL (it is also possible to achieve with one move and
redefines
but I wanted to remove all leading spaces also).Approved
I think its kinda hard for a 7kyu but i solved it with ords so maybe i was just thinking too complicated lol
had fun tho!
and done! thanks for the feedback and examples!
done! highly appreciate the advice and example!
got it, thank you!
will do thank you!
Random tests: random numbers should be generated with
compute input-var = 1000000 * function random()
.Add more sample tests (take them from other languages).
The function name should be
number-to-string
to be consistent with other languages.Random tests: enclose all assertions (
expect
) inside test cases:testcase 'Testing input-var = "' input-var '"'.
(add this line beforeinitialize result
).Add blank lines at the end of Sample Test Cases, Test Cases, and Solution Setup.
Negative numbers should be tested like in other languages (use
pic S9(06) sign leading
for negative numbers).Add more sample tests (take them from other languages).
The function name should be
string-to-number
to be consistent with other languages.Random tests: enclose all assertions (
expect
) inside test cases:testcase 'Testing input-var = "' input-var '"'.
(add this line beforeinitialize result
).COBOL translation ready for review :)
COBOL translation ready for review :)
This comment is hidden because it contains spoiler information about the solution
Ah alright, thank you!
Also, someone pointed out this kata as a duplicate: https://www.codewars.com/kata/544675c6f971f7399a000e79 (convert string to number).
If you have questions about Cobol test framework, you could join us at Discord.
Loading more items...