6 kyu
Jewel Thief
263 of 463dinglemouse
Loading description...
Algorithms
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.
This comment has been hidden.
After you figure out the safe combination, use
open
to open the safe to get to the jewels.Kat Description already says what return is expected:
got it.
This comment has been hidden.
Just why do we have to check for both L00 and R00? Even if they were valid codes, they wouldn't be distinct.
Yes, that may be true in the real world, and if I had received your suggestion 2 yrs ago I probably would have adjusted the rules accordingly.
Unfortunately it is too late now, so you just have to accept that this is an imaginary safe working by its own set of imaginary rules. And in this imaginary world the L00 and R00 are valid and are distinct.
My first node Kata. Console.log() doesn.t work. How can I dump variables during development?
Maybe because it's console, not Console. (it seems to work)
Great kata! Had fun doing this. I thought it would be easier, but in the end I wrote proper Unlock method instead of just dummy, after failing too much on attempts.
Hi, Guys! I am newbie to JS, so, please, don't judge me harsh, I got such an error (see below), when I was testing my solution for this kata here. Can you please, give me, right direction... what is it about? Thank you.
/home/codewarrior/index.js:106 }); ^
SyntaxError: Unexpected token ) at createScript (vm.js:80:10) at Object.runInThisContext (vm.js:139:10) at Module._compile (module.js:616:28) at Object.Module._extensions..js (module.js:663:10) at Module.load (module.js:565:32) at tryModuleLoad (module.js:505:12) at Function.Module._load (module.js:497:3) at Module.require (module.js:596:17) at require (internal/module.js:11:18) at [eval]:1:1
Hi,
you surely forgot to open or more probably to close some other parentheses, squared or curly brackets somewhere eralier (funny part being: you have to spot it by yourself... x) )
Yea, but it has shown error in line 106? Right? I have only about 20 lines at all. That's why I don't understand..
Cool kata!
open function doesnt return anything...i have cracked the combination...
More details please. What language?
it's js
IIUC your code is buggy.
Yes, you cracked the code.
But instead of trying to "open" the safe when you got the correct combination, you continued to spin the dial and so locked it again!!
Thank you very much
dinglemouse
:)This comment has been hidden.
The safe only opens for "click-click-click"
Your "click-click" has only solved 2/3 of the combinations.
This comment has been hidden.
Don't always trust
==
to do what you think it is doing for String comparison.I see, thanks for the hint!
For C# I get the error: Type
Solution.Safe' does not contain a definition for
unlock' and no extension methodunlock' of type
Solution.Safe' could be found. feedback = safe.unlock("L23-R67-R09");@joesmith100 - can you shed any light on this?
@parispapakonstantinou @dinglemouse Hey,
C#, try to use method "Unlock()" instead of "unlock()".
CRACKED! O_o
https://www.codewars.com/kata/reviews/5b45353e6c645b969c0027d8/groups/5b51314fbbfe9d106a000998
Please play nicely!
C# translation added!
Approved. Thanks :-)
see message below
.
?
x)
Please forgive me my JavaScript ignorance. Hopefully it is fixed now.
This comment has been hidden.
language?
Javascript
Have to second this. I actually didn't even realize that this hadn't been done on purpose until I saw other people's solutions. The description should also be updated to let us know that we'll actually be returned a sound ('click') if a combo is right; since I couldn't tell by looking at it, I assumed it was just part of the theme/story of the kata or something.
The description says this already.
Safe object is re-written. Hopefully it is OK now.
The description says this already.
It actually just says "sounds you can hear", but I guess that doesn't matter anymore since the safe properties are now hidden so there's no real ambiguity.
Approved :)
in the table... ;p
Hey, you can pass the random tests easily without having bounds checking in your code. My code wasnt properly checking combinations with 00 in them like this
R00-R98-R54"
so it was failing so i just spammed attempt until the random cases didnt produce an answer with00
in the code. Maybe add some fixed cases that test for it?Anyways, good kata!
Good idea. Done. Thanks.
Your solution is now invalid ;-)
Comparing my solution and yours, could it be useful to add some informations about the way you parse the combinations? (well, II just woke up, I've no real idea about why I choose that approach)
This comment has been hidden.
Hi,
open
method: looks like a string in the table because of the dollar and the comma, but is actually an int)Done. Better?
yep. :)