5 kyu
Shrink the maze!
64Cerbrus
Loading description...
Strings
Algorithms
Logic
Puzzles
Arrays
Parsing
View
This comment has been reported as {{ abuseKindText }}.
Show
This comment has been hidden. You can view it now .
This comment can not be viewed.
- |
- Reply
- Edit
- View Solution
- Expand 1 Reply Expand {{ comments?.length }} replies
- Collapse
- Spoiler
- Remove
- Remove comment & replies
- Report
{{ fetchSolutionsError }}
-
-
Your rendered github-flavored markdown will appear here.
-
Label this discussion...
-
No Label
Keep the comment unlabeled if none of the below applies.
-
Issue
Use the issue label when reporting problems with the kata.
Be sure to explain the problem clearly and include the steps to reproduce. -
Suggestion
Use the suggestion label if you have feedback on how this kata can be improved.
-
Question
Use the question label if you have questions and/or need help solving the kata.
Don't forget to mention the language you're using, and mark as having spoiler if you include your solution.
-
No Label
- Cancel
Commenting is not allowed on this discussion
You cannot view this solution
There is no solution to show
Please sign in or sign up to leave a comment.
Very, very instructive Kata. Thanks!!
Approved!
Awesomeness :D Thanks!
Typo breaks example tests
You mean this line?
There's no typo in there.
=
is not comparison, it's assignment.Method name
Voile: The assingment it correct.
stringified
contains the return value fromstringify
stringify
is a sandbox wrapper aroundstringifyMap
. I'll clarify that in the notes.The wrapper is not allowing console.log?
Ah, that shouldn't be blocked. I've whitelisted
console
in the sandbox now, @dinglemouse.The example maze given in the Kata description is not really a maze - it's just a crooked path through some hedges.
Are all the "mazes" for this Kata like the example, or can they have branching paths like a normal maze?
Our mazes are state of the art. They're randomly generated. Even a actual maze generator won't be as random as these are.
In other words: There's no logic to their structure.
It's just easier to write a little story for a maze, than for a array of booleans.
Ok
This comment has been hidden.
This comment has been hidden.
This comment has been hidden.
lol, i just wrote a nice solution for 19 characters. after that i wanted to shorten my code a little bit and then you changed it to 9 characters maximum :(
I'm considering adding a little leniency for the "compression".
While it's certainly possible to get to 9 (or even 5) characters for the example map, as far as I know, there's only one approach that will get you there.
The approach that results in 5 charactes for the example, only works for smaller maps.
So basically most of the users will have the same approach. I would find it more interesting to give some more space to see more variance. You might can create a harder kata with the same problem but with few characters ;)
Interesting approach, by the way. For really large maps, it might even result in better compression that my intended method, as long as the map isn't too random.
I'll double up the allowed length for now, but that won't really help you with this method...
the test cases are working right now, but none of the random tests. did you change anything? There are still 9 chars maximum ;)
(Hi, Do we have a chance of seeing this one translated to python...? ;o )
I've tweaked the tests a little. They work as intended now, allowing twice the string length of the intended solution.
Blind4Basics: All I know about python is it's name, I'm afraid.
still failing this test:
stringifyMap
returned a value that is too long. Result: 16 characters. Target: 18 characters or less. Optimal: 9 characters or less.Found an issue in the preloaded testing code. It should now tolerate
targetlength * 2
You can encode the example map in just 3 bytes.
Looking at the solutions we're getting, I've removed the "double target length" leniency. My solution appears to be far from optimal, so the goal is to beat that :D
( too sad...! ;) but maybe zruF or Voile will be able to to it? ;)) )
Is that a general solution that will allow any width and length?
Nope, but putting a 2-3 byte overhead it can be done.
Also, there is another way of encoding this, actually, which might be more optimal in some of the mazes.