Hi,
This last weekend, was a mountain rainy weekend, so I decided to start teaching some code to my 7 years old son, we decided to make a calculator, the framework was krpano, and as always it was a nice adventure.
It took about 4 hours designing, thinking the concept and coding it.
As always the details, were the most time consuming part, adding constants like PI, being able to put coma, simplifying code.
The funny part was not having internet to ask for anything like: how to code a calculator in javascript, so everything we wrote was from scratch and had to be carefully thinked.
The final code is about 350 lines everything fully extended (13kb - 4kb minified), it took 8 actions, one array for buttons positions, 1 event for keyboard entry, and one graphic image for visual UI.
After coding this, specially without consulting nothing, I was thinking in how many different ways that could be coded, and I guess everyone would code it on it's own way, a way that is defined by it's way of thinking and of course by it's knowledge.
So I invite you to write your own calculator in krpano script, and let's check it out :
maybe the beginning of the KRPANO CHALLENGES
here is mine
PD : there are still missing features like full query support, and I think some 0 related issues that I will fix ( having the documentation in front) , will have to wait for the next rainy weekend