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 solved this in my PC with gcc. Here with Clang, I can't get the registers. I'm using
__asm__
and the multiple options in the StackOverflow post. Can anybody offer a hint?I'm solving this kata in C.
What's the largest prime the solution has to support?
Why is this wrong solution so highly upvoted?
In C language:
If I add a test
cr_assert_str_eq(solution(1992), "MCMXCII");
it passes.
However, when I submit, it tells me:
The expression (as strings) (solution(1992)) == ("MCMXCII") is false.
What's going on?
As @frogamic, my solution crashes and no feedback is given.
I passed the C version by brute-force submitting until getting >100 right. In all previous submissions it was crashing at some test and giving me the error "*** Error in `/home/codewarrior/solution': free(): invalid next size (fast):"
Now I'm getting:
Can you please check for another typo in the hidden test cases?
I'm getting the error:
Traceback:
in
in scoreboard
in
KeyError: 'hamburgers'
I realized that you misspelled "hamburgers" as "hambrgers" (or so) in one of the tests.
Please let me know when you fix it.
You could assume many many different things about the behavior of the sendFunction, and unless you know what the author intended, you just don't know what to do.
I wasn't able to solve this until I took a lesson on flow control, in a course of computer networking. In the lesson I was like "eureka" and solved the kata in a moment.
I might suggest the author explains better what sendFunction might possibly do, something like:
"""
This is a possibly faulty sendFunction:
function (data) {
var maxsends=3
, nsends=Math.ceil(Math.random()*maxsends);
for(i=1;i<=nsends;i++) network.clientB.recv(data);
}
"""
Otherwise one could assume an infinity of things.
When I try to run this I get
TypeError: Array.map is not a function
Very good practices. Good use of the features of Ruby for maintainability and readability, keeping the code compact with only the indispensale variables without complicating the logic. I wish all the code I read around was this readable.
Just look at my solution. I did it.
Problem: Try [ [0,0] , [0,1.005] ]
It should return "1.01" but returns "1.00" instead.
This is a problem of JavaScript that was not covered in the test cases.
Check this out:
http://stackoverflow.com/questions/11832914/round-to-at-most-2-decimal-places-in-javascript
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/round