[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: