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.
It took too much time to understand, and when I did, it was easy to pass.
Hi,
Very nice one. But imo, it presents one logical flaw and lacks some important edge cases. ;) (coming from ruby)
The flaw:
[0][0]
if the board is[[]]
, so it's out of bounds.Needed tests:
Various invalid starting cases:
Edge cases:
board = [[{color: :blue, star: true}]], robot = {x: 0, y: 0, direction: :right}
:right
(in a valid case)The description could need some cleaning/reorganization too. Mostly, the way it's currently broken down isn't pretty/easy to follow: you have subparts for conditions, stack, ..., but you forgot to put clearly those for the robot, the board and the program. Btw, the instruction part shouldn't be there, since it's actually about the program itself, so should be included in this section instead.
Would be great to add all of this. :)
Cheers
Edit: what about those random tests? (or at least "randomized"?)
Validated! I'll try to suggest a few randomized tests later.
Haha, don't worry, I understood what's needed, I'll do that soon. :) Anyways, since my translation has been openeded for quite some time, I doubt the Kata owner is still active / willing to maintain this kata.
Thanks for the pointers, though!
Hi,
If you fork your (now rejected) translation, you can update the description using the current version (that you'll get doing as if you would create a new translation in another window... That step is a bit boring...) and adding to it the modifications needed for elixir.
Hoping I'm clear enough (but I fear that... X-) )
Hi there,
Not really active anymore but definitely willing to fix this if this can help, what would be needed to be changed?
rejected, since korrigan sn't ctive anymore and his translation has now description conflict. This way, other warriors will be able to publish other elixir transalations.
Very well done kata! I love Robozzle because it can teach non-programmers a little bit about programming without having to actually use code.
An idea for a (much) harder kata: Given a board and starting location, generate the program that will solve it! :D Not sure if it's even possible. But I suppose it's just meta-programming. Would be tricky, for sure.
Very nice job!
As noted above it lacks of random testcases, but they're a pain in the ass to build for such problems so I cna understand that it takes a little time ^^
I played robozzle before and I remember creating a little python version of it on my free time... You reminded me some great time there! :D ♥
I changed the requirements to remove the stack from the expected return value so I'm flagging your suggestion as solved.
Please let me know if you think of any other enhancements. :)
Yes! It's a good kata. Like myjinxin said, could use random tests, but those do seem difficult to generate. The description is particularly detailed, which isn't often the case :P
I haven't played the game and it's blocked by my "No-games-content" work internet :/ so I need to check it out
Hi,
For the input data, I first thought of a multiline string encoding the map and the robot position altogether, which obviously will be more readable but will require warriors to transform the input to adequate data structures (or worse, some might want to try to deal directly with the map instead of using well-suited data structures). I felt this would be unecessary boilerplate code in solutions so I'm not satisfied with the idea either.
Maybe a good alternative would be to provide a helper function to print the map and the robot in a more human-readable format (and include an example test case that demonstrate the feature). What do you think?
For the random tests, what would be the goal of them? Avoid cheating? (I ask because I've already seen suggestions for random test on other Kata and I'm not sure of the point)
Anyways, it is indeed possible to implement some with one of the following way:
Both of the solutions will require quite some work but I promise I'll take some time to think about that. I prefer the generator since it would then be possible to provide the generator functions to warriors, which will provide value in the sense it can help understanding the game.
Thanks for the feedbacks, I hope you enjoyed the Kata :)
Hi,
Thanks for the feedback, it's my very first authored Kats and I definitely appreciate the valuable feedback.
I think I will remove the stack requirement then since it actually seems to be painful to get it right and provide no value to the tests (in fact my original Ruby solution had the very same issue with my tests so I reversed the stack before returning too since the order imposed by the tests seemed more logical to me), it will also have the nice side effect to remove boilerplate from the tests and make it more readable.
I hope you enjoyed the Kata despite this weird behaviour
Seems like returning the state of the stack is iffy, because some people may implement it differently. Your tests are expecting the stack to be returned in the reverse order that my solution has it in, yet my solution still passes every other test.
In other words, I am ostensibly executing actions (popping them off the stack) in the correct order, yet my stack is reversed from your stack. There's only one test where the final state of the stack has more than one action on it (the painting test) as well (so that's the only one I failed). So I simply reverse my stack when I return it, and I pass all tests, which is kind of weird.
Loading more items...