Intro 🌐
Problem solving is an important skill, for your career and your life in general.
That's why I take interesting katas of all lev...
For further actions, you may consider blocking this person and/or reporting abuse
Thanks for this post. It was interesting to see how you approached the problem, broke it down and came up with different solutions.
I prefer the floor method as it looks cleaner to me and more concise. Why write 15 lines when you can write 4? Though let me know if I am wrong.
Why write 4 lines when you can write 1? 😁
Hey there,
I think it's a good to stay sharp,
so I try to come up with different solutions,
depending on how much I enjoy the problem.
By the way, you missed the
seconds
parameter in your function definitions. Running them gives an error.__But where is var p declared? Only one line is not posible ;)
It would be:
Perfectly possible. There was no rule about not polluting the global namespace. The function works just fine
Or, if you don't want to pollute globals:
Ok, I executed it on node.js.
The latest solution change the contract of the function.
So? Still solves problem, and still works. Just showing how it could be written in a short way. Code golf. I'm not advocating for this style in project code.
It still only accepts one parameter (function length is still 1) - nothing in the description of the task says we can't also have an optional parameter 😀
yeah! It's cool, no problem! 😉
Happy 30th kata, Michael! 🍰
Great work 👍
Hehe thanks!
I think I will rework the katas,
remove some clutter and put them into a PDF.
Ideas on this?
🙂
Sounds great!
Do you have a particular use case in mind for PDFs? (nowadays I often prefer websites over pdfs)
Maybe consider adding
smart
/best practice
solutions from Codewars (lots of brilliant solutions there!)Great idea!
PDF was my first idea, because it is easy to download, to use at home and to archive.
But the more I play around with it, the more annoying it becomes to convert 30 markdown files to PDF, while giving it a good user experience 👀
Any suggestions for an existing tool that can create a nice website from markdown files?
Otherwise I will look for a simple Gatsby theme.
Yeah, I think it has been a couple years since I used PDFs as knowledge source, website might be more convenient today.
Imho, it partially depends on your current website stack (thought you might want to amend that to your existing one).
I've used react-static and then switched to nextjs for
.md
sourced pages, both are good enough solutions. Haven't had a chance to try Gatsby yet, should be a solid solution from what I've read. Btw, if you haven't already — it's a good chance to try.mdx
(still on my to-try list).Also, recently I've finally tried gitbook — had a great experience with it!
(though it wont fit if you'd want to extend it w/ playground or something)
GL
I'm using Gatsby and I'm using it with
.mdx
.Actually a good idea to have a look into gitbook.
And to have a look into a playground thingy, to remove the dependency to repl.it.
Thanks for your ideas.
Sometimes new ideas postpone a solid release 🙂
let toMinutesAndHours = (seconds) => {
let countHour = seconds / (60 * 60)
let reminderOfHour = seconds % 3600
let countMinute = reminderOfHour / 60
console.log(
${parseInt(countHour)} Hour(s) ${parseInt(countMinute)} Minute(s)
)}