mandag 6. desember 2010

New scripts!

I had a productive day yesterday, and I learned that a python program is normally called a script, as python is a scripting language. I'm still sticking with 2.7, but realize that I need to get into python 3 if it's going to be useful for me. Yesterday I produced several scripts, I made another pass at the Norwegian edition of my "liturgic lexicon", and I hope to be able to make that into something lasting, and potentially useful.
Another old idea that I picked up was a program generating random numbers for use with lotto games. The improvement was that in the new script one may also choose the number of digits to play on, thus the script can be used both with VikingLotto and ordinary Lotto, and even football and horse betting. I think I might want to explore further gambling games maybe using graphics.
The greatest achievement though was the program that supplies a test of the lower multiplication tables, from 1 to 12, potentially something that my son can use while learning how to work out multiplication maths.

søndag 5. desember 2010

Vidar's Calculator!

Vidars data blog is going to be updated a little more often from now on. Slowly I'm learning ways to work python scripts.
I have now made a menu-driven calculator script, a piece of work done almost entirely without consulting books. It handles 6 different types of maths.For accounting addition I will have to set up another script, so only up to four numbers may be added at one time. Forcing the division to present the answer as a floating point number(i.e. with decimals) was also a challenge, that finally could be overcome. Python 2.7 prefers to give you answers in integers, thus applying the "remainder"-function in division, which for everyday calculations have little practical use.
I was fairly satisfied with this latest calculator script, I hope that the next time I deal with a maths script, it may even be with some graphics, either a program that draws graphs from number input, or even a calculator that looks like a calculator, but that will have to wait until I've learned more.