Let’s Solve For Pi!

October 24, 2011

I told myself I’d at least have one new post during this one-month break. Here goes…

I dug up one of my old programs. When I say old, I mean it’s the very first (useful) program I finished. Er, one that I actually finished. When I was young (sophomore high school, to be exact) I usually got bored and never finished any of my programming projects. 😀 (Awsm RPG comes to mind… :|)

Anyways, looking how it worked, it seemed pretty neat, though it seemed improper for this program to be written in a game development software. That’s right– I wrote this old one in Game Maker 6 if I recall, all using its scripting capabilities. That goes to show how powerful GML is, or how patient I was with an interpreted language. Either way, that makes it cool(er), doesn’t it?

So I took some time today to rewrite and refactor the program, mainly to move it into a new programming language, C++, and to simplify it. Though the program now sucks because its interface has been reduced to a command-line one, I say it’d be better this way. Without all the Game Maker code bogging it, I have more freedom to expand the program to however I want it. And also I’m more familiar with high-level languages like C++ anyways. So rewriting for simplification and for refactoring.

The premise of the program isn’t too hard to comprehend. It’s a simple looping program with an algorithm solving for Pi. Yes, Pi, as in 3.14159265358979BLAHBLAH. To avoid deviating away from the topic at hand, I’ll write all about solving Pi (and the related algorithms) in another post, for those of you who’d find the discussion too boring. (If this is too boring for you, then why are you reading my blog in the first place?)

So I’m uploading the two programs, the old Game Maker one, and the C++ one. Also I’ll include the source for anyone who’s interested, though to fully understand it you’d have to read my article on Pi. Here ya go.

One comment

  1. […] Ultimate Nerd InstilledBee's personal blog « Let’s Solve For Pi! How solving for Pi works. October 24, […]

Comments are closed.

%d bloggers like this: