[Community Puzzle] Detective Geek

Hi nice puzzle but my tests are failing because of unknown characters
using typescript and String.fromCodePoint(number) method
aprdec returns me value of ƽ which makes return string imposible to be correct

maymay decode 4 52 from number: 44
maymar decode 2 50 from number: 42
aprdec decode ƽ 445 from number: 311

Not sure what your problem is? All can be decoded into valid characters:
maymay => 4 x 12 + 4 = 52 => the character “4”
maymar => 4 x 12 + 2 = 50 => the character “2”
aprdec => 3 x 12 + 11 = 47 => the character “/”
And I have just done the puzzle in TypeScript. All the tests and validators can be passed.

This is my problem i get 311 cast to base of 12 and get 445 after decoding it
i get ƽ

I think you added two strings together instead of adding two numbers together?
e.g. 3 and 11 should be interpreted as 3 * 12 + 11 instead of 311.

I used parsint(aprdec, base)
445 = parsInt(311, 12)
But i think you opened my eyes but maybe i am wrong
i should convert dec to base of 12 and apr to base of 12 and then sum them up?

3 is treated as the first digit, and 11 is treated as the second digit in the base-12 number.
It’s a bit like how you would interpret hexadecimal numbers.

*Each month represents a number according to its order in the year. "jan" = 0, "feb"= 1 ,"mar"= 2 ... "dec" = 11*
  • The string of two months represents a two-digit base 12 number. So octapr is 93*
  • 93 in base 12 becomes 111 in decimal*
  • and the final step is to look in ascci table to see what letter correspond to 111.*

this is from task and i do not think you can get 111 from 93
the way you suggests
but 93 parseInt("93",12)

ParseInt(“93”, 12) gives you 111.
But “311” has to be revised as “3B” as “B” is 11 in base 12.
ParseInt(“3B”, 12) gives you 47.
If you have further questions, please feel free to PM me :slight_smile:

2 Likes

well you live you learn
Big thanks

1 Like

Test 1 in the validator still doesn’t pass, 85% Correct…

This has been mentioned a number of times in this thread. If you have not read the thread before asking this time, please do so next time! :slight_smile:

A minute of silence (o7) for those who tried to use 10 and 11 instead of A and B? I’m one of them.

But if you think about it, it’s not obvious that you need to use the letters A and B instead of indexes 10 and 11 (and I’ll note that 511 is just as valid as 5B), because we are literally told to combine two indexes together; and only this line hints that you need to use letters:

The string of two months represents a two-digit base 12 number.

and even then it says TWO DIGITS, and I don’t remember when A or B became digits?! And I can only draw one conclusion: the condition is poorly written and intentionally or not misleads the person solving the puzzle and I don’t understand how such a condition could get approved three times(@pshemke @Juanmv94 @aymane212)!

P.S. I want to point out that @aymane211 → changed his name to @aymane212

Just like you said, you were expected to convert the months into a valid base 12 number so that you can properly convert them to base 10. As the statement says, ‘two-digit’ — if it’s 3 (101), make it 2 (a1).

:x: int(“101”,12) → 145 → \x{91}
:white_check_mark: int(“a1”,12) → 121 → y

If you don’t, it would yield noticeable weird results anyway. It’s really just a reading problem.

I read your answer several times, but in my opinion it has nothing to do with what I was complaining about.

Be careful, it’s said exactly that :

The string of two months represents a two-digit base 12 number.

And, in base 12, “digits” are 0;1;2;3;4;5;6;7;8;9;A;B … as C;D;E;F are “digits” too in hexadecimal.

By the way, there can be a misunderstanding here due to a bad assessment of “digit” term, which should mean here something like “symbol representing a number”, and not “numeral symbol”.

That said, I found the puzzle too “easy” in the sense that the wording was too detailed for my taste. We literally had to code the wording line by line, and I would have appreciated a few more intentional gray areas to stimulate our analysis.
Good plot, though!

Yes, I misinterpreted the word “digit”.

1 Like