When you leave, my challenges fade to grey, 0A0AE16, 0A0A0AE16...
A while ago, I made this programming language (https://esolangs.org/wiki/Dragostea_din_tei) which uses an interesting number system. It is base two for integers, but for decimals it divides a base two integer by a power of ten.
The input should be a floating point number, negative, positive or zero.
The output should be "the" standard representation for, that number, in the programming language, which should follow these steps:
- Start with the absolute value of that number. Now multiply the result by the smallest power of ten to make it an integer (for example, 123.45 -> multiply by 100 to make 12345) and call it a.
- Write
Ma-ia hii
+ a newline (literally, push the number zero). - Write a in base two, with
Ma-ia huu
+ a newline for ones, andMa-ia hoo
+ a newline for 0's. - Now, if the original number (not a) has any decimal places, write
Ma-ia haha
+ a newline for every digit after the decimal point, for example twice for 123.45. - If the original number is negative, write
Vrei sa pleci dar
.
You can add or omit trailing and leading newlines if you want.
DONE. Now, here are some good ol' examples: -10 is:
Ma-ia hii
Ma-ia huu
Ma-ia hoo
Ma-ia huu
Ma-ia hoo
Vrei sa pleci dar
256 is:
Ma-ia hii
Ma-ia huu
Ma-ia hoo
Ma-ia hoo
Ma-ia hoo
Ma-ia hoo
Ma-ia hoo
Ma-ia hoo
Ma-ia hoo
Ma-ia hoo
And 3.14 is:
Ma-ia hii
Ma-ia huu
Ma-ia hoo
Ma-ia hoo
Ma-ia huu
Ma-ia huu
Ma-ia huu
Ma-ia hoo
Ma-ia huu
Ma-ia hoo
Ma-ia haha
Ma-ia haha
And finally for -3.14:
Ma-ia hii
Ma-ia huu
Ma-ia hoo
Ma-ia hoo
Ma-ia huu
Ma-ia huu
Ma-ia huu
Ma-ia hoo
Ma-ia huu
Ma-ia hoo
Ma-ia haha
Ma-ia haha
Vrei sa pleci dar
This is code-golf, so fewest bytes wins!
3.14000000000000012
for3.14
. Floating point representation nonsense. :P \$\endgroup\$-3.14
? \$\endgroup\$