HFOSS Team Project Update

by Lance Laughlin

So we are now a few weeks into our team projects (I think?) For those of you how don’t know about the project check this link out: http://beta.chrisknepper.com/2013/10/xopc-team-proposal/

We spent the first couple of weeks mostly planning, this involved our artists creating some sketch mockups as well as planning out our development cycle, including creating tickets on our Github repo. The first week or two was probably the most challenging thus far. We all had different visions for what the project should look like and it took a little bit for us all to get behind one idea but we finally landed on Fractionauts.

So far I’ve been tasked with creating a questions class for the game. This is basically a class which will be instantiated and will result in a question object that holds, the goal fraction for the player, all the possible choices, as well as a reference to the correct choices. I wanted to incorporate some randomness into the game so I did so here by creating a random goal based on a subset of the possible answers.

Overall, this process went fairly smoothly. I was initially having trouble finding a way to randomly generate some decimals without going over 1.0 total. Mike Nolan (Nolski) and I brainstormed a bit and he had a really good idea of breaking 1 down into groups based on how many correct answers there would be. So if there were going to be 4 correct answers I would break 1 into 4 pieces of .25 and then generate a random decimal between 0 and .25 for each section; therefore, preventing it from ever exceeding 1.0 total.

I’m mostly done with this class so far. I still need to implement the other operations besides addition. Subtraction should be pretty straight forward aswell as multiplication. May run into a bit of trouble with division but we’ll see about that tonight when I try to tackle it.

Another issue I was having is converting the decimals into fractions. Python has this pretty cool Fractions module that you can import: http://docs.python.org/2/library/fractions.html while it does return a fraction when you pass it a decimal, it’s not reduced. So we will need to find a solution for that before too long. Most of the math under the hood will probably use decimals anyway…so it’s mostly for presentation.

We are moving along nicely and I think we should be good hitting our first milestone.

Happy coding!