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.
looks similar to https://www.codewars.com/kata/possibilities-of-throwing-a-coin-n-times
Fixed.
Something seems wrong with the first sample C++ test. The expected makes no sense.
Expected: equal to [ "HT", "HT", "HT", "HT" ]
Actual: [ "HH", "HT", "TH", "TT" ]
Update: I see now; the Expected and Actual are reversed in the test.
Fixed the precision of printed values.
Hey, I really think that you should mention that strings are not the standard way of representing bigintegers, and to speed your code up, you should use an array of unsigned longs instead. I fell too deep into the string bigint rabbit hole before I realised myself.
https://www.codewars.com/kumite/6319e777b80b15c8265ce45c?sel=6319e777b80b15c8265ce45c
NASM translation!
dude what the~
Those informations are better in solution set up.
@avighna the solution setup had already had
extern malloc
The function declaration in comment
char *play_pass(const char *phr, int shf)
prompts thatphr
is const and should not be modified!Anyway thanks for adding the comments in description!
But now your fork can only be approved by the author or admins.
@g964
The fork is ok!
've thought that it is clear from the function header to allocate memory yourself...
Exact floating-point equality is completely fine in this kata. Floating-point computations are not random. All rules are specified in the description (make sure that everything is evaluated from left to right and use the most precise conversion from strings to numbers).
Well, what's the difference? I could do that, and it might make it easier, but if you chose NASM, you shouldn't be expecting it to be easy. Unless there's any other reason, of course.
Since the length of resulting string is known (can be easily calculated) upfront, dont you think it would be better to pass in a pointer to a preallocated output buffer rather than returning a malloced buffer from solution?
Hello there! I didn't use
cr_assert_str_eq
because, well, I didn't know that was a thing. I'll change it right now.EDIT: Done, it's
cr_assert_str_eq
now.The assertion messages are kinda useless:
The expression (result) == (0) is false.
Why use
strcmp
in tests, and notcr_assert_str_eq
?Loading more items...