(Simple) Automated Marking Solutions

Automated marking solutions save us teachers valuable time. I dont think I need to convince any actual teachers of the value of these systems. And the problem is that almost no schools or institutions use these (quite possibly because the vast majority of systems are rife with problems), which holds true even for Universities which have no shortage of IT and Engineering experts. In this article though I wanted to present a list of Automated Marking solutions for common response types.

Gnowledge is a free, ASP.NET based online service. You create an account and create quizzes which are really easy to use. You need to use curly braces to define answers sometimes though, which might be a little offputting to some. The biggest problem is that it uses a central repo to store all tests – theres no such thing as a private test and you cant name a test something thats been used by somebody else.

Google Forms
Google Forms works well for MC and non text data, but it feels like it was designed more for surveys than quizzes. Very easy to use, but it doesnt show the user instant feedback and so on.

TAO is an open source, downloadable eTesting solution. In theory, its perfect. In practice, its far too difficult for most people to use in my opinion.

Classmarker probably is functionally the best system that I’ve seen. It’d be perfect if it didnt limit you to viewing around 100 tests freely per month and cost an arm and a leg for a pro version.

qQuiz started as a closed project for first aid quizzes by Stewart Watkiss, but hes been a good samaritan and released it as open source, so you can host it on your own server.

Don’t count calories – count grams

Everyone tries to count calories. But how accurate are you? Are you, like most people, taking wild guesses at the caloric content of that pad thai, sushi or hamburger? If so, you could be way off. If you’re eating like a pro body builder and are literally counting the calories of every ingredient in whatever you eat, that’s a bit of a different story. But if you want a social life where you can eat out now and then, buy ready made food and try to track what’s in it, give this a shot. It’s working wonders for me.

Target calories:

This tool works great when you combine it with this one.

Why I’ve become anti anti-persperant

Anti-persperants are a pretty integral part of most of our shopping lists and they’re pretty well accepted by society; Lynx preys on it’s targets by convincing them that if they use their product, they will somehow be a woman magnet. Rexona pushes it’s sport performance using icons like Ricky Ponting. But has anyone ever stopped to consider whether or not these products are actually in our best interest to use? It’s funny – us fitness fanatics are constantly reevaluating what we put in our bodies, but not what we put on them. Anyone familiar with the concepts of osmosis and diffusion know that what we put on our bodies essentially goes in our bodies.

Why am I talking about this? What’s the big deal? Well, I had an epiphany after I had a sebaceous cyst form under my right arm. This thing was huge, I couldn’t even wash my hands without it being painful, so I couldn’t even think about training. The procedure to get it cut out put me out of training for a good month as well, but that’s another rant. According to my GP, the whole thing was caused by aluminum in the anti-persperant that I was using, which blocked my pores.

People usually just think that our pores release sweat, which is true. But they also release sebum, which is an oil that coats our skin and hair, secreted by our sebaceous glands. Blocking this oil with crap like aluminum found in anti-persperants resulted in my cyst.

The result: I’ve become a bit of a naturopath. Not extremely, to the point of rejecting western medicine, but I am looking for natural alternatives to things that I’ve now discovered are loaded with chemicals and I’m not so sure I want all those industry grade chemicals on my body. Things like laundry liquid, deoderant and soap are high on my “natural” list nowadays. And if you think you wouldn’t mind trying the natural approach (and saving yourself skin problems down the line), here is a link to where I get all my stuff: http://www.organicsaustraliaonline.com.au/

Why low GI doesn’t mean anything

If foods are digested slower, its a more steady release of glucose into your bloodstream with a more steady release of insulin instead of a spike. You’re also kept fuller for longer. This is the usual argument for low GI foods – which I was an advocate of in the past.

But all this means is that the glucose gets to live in your bloodstream a little longer. At the end of the day, it will get collected by insulin (if it isn’t used) and stored as glycogen and excess glycogen is stored as fat. Period. It doesn’t matter how slowly 3000 calories of glucose get digested and released into the bloodstream. If your glycogen stores are full, all that glucose is getting turned into fat. And if at the end of the day (figuratively speaking), your caloric output is less than 3000 calories, that fat is going to sit there.

So the “low GI” craze isn’t as important as I once thought it was. My new conclusion is calories in vs. calories out is the single most important factor in weight loss or weight gain. That doesn’t mean you limit your understanding of the human body to those numbers – there are biochemical reactions taking place that are great to learn about. But before anything else, calories count.

Weight loss: Breakfast is not the most important meal of the day

You always hear people rant on about how breakfast is the “most important meal of the day”. And I would kindly reply, “BS!” Let’s break this down.

The argument for eating breakfast every day is something along the lines of “You need the energy”. Really? Most peoples example of breakfast is a sugar-loaded injection of at least 250 calories that gets digested in about 15 minutes and released into your bloodstream, causing a huge release of insulin that sucks up all that glucose and stores it as glycogen or (if your glycogen stores are full), fat. Let me explain that.

The usual examples of breakfast are a kind of cereal or toast. Two slices of white bread makes up about 150 calories, mostly from carbohydrates, which get digested and converted to sugar pretty quick. Add another 50-100 calories of whatever sugar and fat loaded spread you would use, plus butter. A glass of skim milk is about 110 calories worth, with roughly equal parts protein and sugar (lactose). Skim milk doesn’t have much fat. Let’s assume you are using skim milk and only use 250ml (1 glass) – the cereal you use is also loaded in sugars (at least in the form of carbs), so that jacks your breakfast up to at least 250 calories. From sugars.

You might argue, “Brah! I have oats for breakfast.” Still exclusively carbohydrates. Which is essentially sugar.

But wait, don’t I need those 250-ish calories to last me until lunch? Well first, you forgot that they’ve already been absorbed because they’re most likely high GI and injected into your cells by insulin, so you don’t actually “have” that energy floating in your bloodstream anyway. Even if you do go low GI though, if you’re looking for weight loss, why provide your body with those calories as soon as you wake up, when you can fast until lunch and force your body to resort to your existing energy stores – glycogen, then fat.

If you’re looking to maintain or increase your weight, then breakfast is justifiable. But if you’re trying to lose weight, you’re robbing yourself the opportunity to burn more stored energy through fasting. Oh, and heaps of people are probably gonna jump to the words “Starvation mode” when they hear this. Find me an article that proves the existence of ‘starvation mode’, that critically slows down internal biological processes enough to drastically reduce your BMR. The only metabolic process that I can see that slows down by not eating is digestion.

How the human body stores energy

I’ve been meaning to write another health blog for a little while now. Today, I actually learned about a new type of energy that your body uses and thought I’d post a blog about it – as well as the other types of bio energy that I’ve learned about.

As far as I know, there are 3 types of bio energy that’s used in the human body; Glycogen, ATP and Ketone Bodies. Let’s talk a bit about each of these.


I’ve talked a bit about Glycogen in some of my older posts, but let’s revisit it now too. Glycogen is basically a form of Glucose that’s stored in your muscle cells, as well as your liver. Glycogen is sourced from carbohydrates and sugars, so a low carb diet results in (or at least aims for) depleting your bodies Glycogen stores so that other energy deposits (fat, basically) need to be utilized instead. When you consume carbohydrates or simple sugars (the two fall under the same category here), glucose is released into your blood stream. How quickly the glucose gets released depends on how quickly the carbohydrates in the food source can be digested – this is indicated by the Glycemic Index. When your blood sugar levels (blood glucose) rises too much, your pancreas secretes Insulin as a homeostatic response (a means by which your body regulates its internal conditions). Insulin collects the glucose in your blood stream and stores it as Glycogen in your muscles and liver. Conversely, when your blood sugar levels are too low, Glucogan is released that catabolises your Glycogen stores (not fat stores) and releases the glucose into your blood stream. Glucose is stored in your muscles, so it can be quickly metabolized to provide a fast source of energy, as opposed to fat.

ATP (Adrenosine Triphosphate)

ATP is another form of stored, biochemical energy that exists inside your muscles. ATP is used for small, quick releases of energy – often anaerobic exercises, like weightlifting. Glycogen is converted into ATP through a process called Glycolysis. As such, Glycogen could be suggested as a precursor to ATP – which is why consumption of Carbohydrates is important for optimal performance in the weight room. Does this mean that we should overload on Carbohydrates though? I read somewhere that the body on average can only store about 600g of Glycogen at any one time – any remaining Glucose in the blood stream would most likely get stored as fat, which you probably don’t want. Unless you’re using the Carbohydrates you consume, your Glycogen stores are filling up and any extra carbohydrates coming in are probably going to end up as fat.

Ketone Bodies and Fatty Acids

This was a new one for me today. When your Glycogen stores are depleted, your body becomes Ketogenic (I’m not sure which hormone causes this, if any). This causes Ketone Bodies to be produced by catabolising fatty acids. These Ketone Bodies (which I’m fairly sure are not actually a form of Glucose but an entirely different, lypid (fat) based energy source) can then be used as an alternate fuel source. The process of producing these Ketone Bodies as a result of fat catabolism is called Ketogenesis. So when people go on a low carb diet to deplete their Glycogen stores, they are aiming to cause the production of Ketone Bodies, to catabolise their fat deposits.

However, Ketogenesis is not the only way of catabolising fat deposits. Lipolysis (the breakdown of fats into fatty acid energy – which could be suggested as similar to Ketone Bodies) can be triggered by the following hormones: epinephrine, norepinephrine, ghrelin, growth hormone, testosterone, and cortisol (sourced from Wikipedia – like most of the information in this blog post).



So, which of the 3 energy sources do you want to target? That depends on your goals. If you’re training for muscular performance, including muscle gain, you want plenty of Glycogen and ATP to fuel your muscle cells. If you’re trying to lose weight, it makes sense to keep your Glycogen stores low and maximise your metabolisation of fat deposits through ketogenesis and lipolysis. In saying that, there is a lot of talk about these catabolic processes (ketogenesis and lipolysis) also having a catabolic effect on muscle mass – though I haven’t read this in any of the Wiki articles.

As the Hodge Twins say, “All of this is just advice. You go out there and do whatever the #@!$ you wanna do!”

Soy-free protein bars

In my post on protein powders, I was saying how soy is basically evil for bodybuilders because of the phytoestrogens that it contains. I mentioned that there are a few brands that do ship soy-free protein poweder such as Protein Factory, ISOWhey or another one that I found recently is EZProtein. But if you thought it was hard to find a soy-free protein powder (I sure did!), its even worse to find a soy-free protein bar.

I searched most health stores around my area and they all seem to have pretty much the same products – all with Soy in either protein or lethecin form. But when I broadened my horizons to the international market via a google search, I did come across a few alternatives.

  1. Organic Food Bar.

    Organic Food Bar offers a protein bar thats basically made from Almonds and Rice. It packs 22g of Protein per serve and it doesn’t have Soy Lethecin.

    We do not use Soy Lecithin anymore — and, this is a little known fact — most, if not all, soy is GMO contaminated, even the organic variety! Few food companies make changes on the fly based on a changing world. But, ORGANIC FOOD BAR is constantly making adjustments to bring the most current and updated findings to the health of our bar. This is the reason we removed soy from all our products. ORGANIC FOOD BAR stands alone as the pioneer and leader of RAW organic movement since 2001. And, that commitment is stronger than ever within a food industry riddled with compromise. When it comes to your health — your most precious asset — ORGANIC FOOD BAR makes no compromises.(source)

    The verdict? I didn’t like that they don’t disclose the nutritional information of their product on their website and that they have an article on “why is our fat content so high” in their FAQ page. So I kept looking.

  2. Perfect Food Bars.

    Perfect Food Bars offer a range of different flavoured bars, with no added Soy. Actually, here is what the manufacturer (who has his Phd – brownie points) has to say about soy:

    Soy free. Research suggests soy consumption might be linked to several health conditions including: bloating, hormonal imbalance, unusual weight gain, and allergies. (Hidden Dangers of Soy by Dianne Gregg.) The problem with soy is that most products you find at the grocery store have some form of this ingredient – you have to know what to look for because it’s hidden in so many ingredients.(source)

    The problem with these bars is that the fat and carbohydrate (and sugar) content is either greater than or equal to the protein content. This is probably expected since these bars aren’t actually produced for bodybuilders. But sadly, the macros are all wrong for my books. So I kept looking.

  3. Vega One Bar.

    Vega actually has a bunch of health products at their store, the one with the highest amount of protein (15g) being the Vega One Bar. This also doesn’t have any Soy and is packed full of other vitamins and other micronutrients, which gives it an edge in the overall health area. Fat is lower, about 7g, protein is at 15, but carbs are still somewhat high-ish at around 25g. This is actually the overall best so far in my books (especially given all of the micronutrients – I used to underestimate how important these are), but the carbs are still putting me off a bit. So I kept looking.

  4. Zing Bar.

    Zing has a fair range of bars on their site that you can buy individually or in groups of 12. What was really great to see was their opinion on Soy Protein, with academic references. It’s a bit too long to post here, but here is the link.

    The downer is that the Zing bar still only has 10g of protein, about 25g of carbs and about 10g of fat. Based on the additional micronutrients, I think the Vega One bar has the win so far overall, but the Organic Food bar takes it if you’re just after the protein hit.

  5. Rise Bar.

    The rise bar (almond-honey flavour) is equal protein to carbs at 20g and slightly less fat at 17g. The macros here appear decent, but I still like how the Vega One bar had so many micronutrients

Summing up!

To sum up, I like two bars in particular. The Rise Bar (almond-honey) and the Vega One. There are actually a few other comparisons of protein bars out there too. One that I found is here. So hopefully this list has at least exposed you to a range of alternatives to the soy-filled crap on the market here in AUS. You might have to order international, but at least you can get good quality protein bars for in between meals.

Cholesterol and Bodybuilding

So over the past few weeks I’ve been trying to increase my cholesterol levels (among other micronutrients, but let’s stick to cholesterol for this blog entry). Why on earth would I want to do that, you ask? A good question. Cholesterol, I discovered, is actually a precursor to a range of steroid based hormones, including Vitamin D and more importantly, testosterone.

I wanted to increase my natural testosterone for better muscle gains and athletic performance and I thought that more cholesterol would enable me to do that. I was wrong. Here is why.

First, more cholesterol doesn’t mean more testosterone. They leydig cells (which make the majority of your test) do synthesise cholesterol to make test, but only when stimulated by leutinising hormone, which is released by the putiary gland. So no matter how much chol you have, unless your LH increases, your test production will be the same, since there isn’t any more chol synthesis happening.

Second, the human body is homeostatic and cholesterol, like most substances involved in regulating human body function, invokes a homeostatic response when its concentration changes. The majority of your chol is produced by the liver, though a small amount is produced in every other cell in your body. If you start consuming more chol in your diet (which is poorly absorbed anyway), you will just trigger a homeostatic response that reduces the amount of chol produced in your liver. So your chol will remain roughly the same, but you’ll probably gain weight from all the fat content contained in the cholesterol-rich food sources (just like I did).

Last, you might look at your chol levels on a blood test and think that you can still increase your chol by a decent amount and stay in the safe range. But what you haven’t considered is that this range doesn’t apply to every single person. Your own “range” of cholesterol will be unique and genetically coded. If your chol concentration changes, you may trigger a unique homeostatic response, not necessarily just at the thresholds indicated on a blood test

So the verdict – forget about increasing your Cholesterol to make more Testosterone. Yes, now we know what it does, which is good, but I really doubt that it’s worth actually playing with to increase your test (you’ll probably just end up just gaining weight like I did before stumbling across the truth). There are other substances though that might be able to increase your natural test and I’ll be blogging about my experience with those later.

Protein: All the same, right? Wrong!

Warming up…

I used to think that protein was more or less all the same. I mean, protein is protein, right? If I’m taking a protein powder that offers 74g of protein per 100g serve, that’s good, isn’t it? If I’m eating tuna that offers 26g of protein per 100g and has hardly any carbs, fats or sugar, that’s great, right?

As it turns out, there are actually several different kinds of proteins out there. The common ones that I’ve found are:

  1. Whey
  2. Egg
  3. Casein
  4. Soy

And there are pretty much three main differences between them. First is the rate of digestion. Second is the protein absorption ratio. Last is whether its a blend, isolate or concentrate.

Rate of Digestion

The rate of digestion is important with protein just like it is with carbs (see my last article on Bodybuilding Hormones and Supplements). If your protein gets absorbed quickly, you hope it gets injected into your cells where its needed and does its job. But then, there’s no food or protein left in your stomach or blood stream, so you’ll need to consume another protein source again soon to keep your muscles fueled and supplied. With slower digesting protein, it digests slower. So its a less potent protein hit, but sustained over a longer period of time.

So which one do you want? Actually, both – but at different times. When you wake up in the morning, for example, your body hasn’t had a protein hit in 7-8 hours. So you want to give your muscles their protein hit quickly, with a fast-digesting protein. Before bed or between meals, you want a slow digesting protein that’s going to last until you can eat again. Now it comes down to the name and shame game. Whey is labelled as a fast-digesting protein, which makes sense since its derived from liquid extracted from curdled milk. Casein is considered a slower digesting protein, and is made from the curds (solids) of curdled milk. How do soy and egg protein stack up in the digestion game? I don’t know and there doesn’t seem to be much on them from this perspective. But Whey = fast and Casein = slow.

Absorption Rate

What about this absorption ratio I mentioned earlier? I thought that if I eat something that contains 25g of protein, I get 25g of protein into my system? Actually, no. There is an indicator known as the Biological Value (BV) that indicates how much of the protein you’ve consumed from a protein source actually gets absorbed into your body. Whey has the highest BV score, followed by Egg, Casein and Soy.

Blend v Isolate v Concentrate

A blend is probably the most common form of protein you’ll find. Essentially, a company comes up with a combination of different protein types in different quantities, throws in some amino acids, maybe some creatine, maybe some dextrose or carbohydrates so they can market the product as FAST ACTING! and patent it. An Isolate is basically where they extract the protien out of the Whey or Casein (or whatever your protein source is) and leave out the rest of the fats, water, etc. An Isolate is usually preferable to a concentrate, which has all the other components of your protein source still in tact. Personally, my vote is for a 100% Whey Protein Isolate and a 100% Casein Protein Isolate

Soy – EVIL!

Since Soy contains the lowest BV scores anyway, you may not really be looking for Soy products. But the other real problem with Soy is that it contains estrogen inducing substances. So more Soy = more estrogen pretty much. Just in case you didn’t know, Estrogen is a female hormone that reduces your muscle gains and increases fat retention (opposite of testosterone). So it’s pretty evil! Here is the real question – does it need to be pure Soy or can Soy Protein cause the same effect? According to an article from dietsthatwork (with its own references – you can follow those if you want to dig any deeper), Soy Protein is well known to raise estrogen levels. To top it all off, Soy Lethecin is a hidden killer that does the same thing and is found in 99% of the protein supplements I’ve found! The only places I’ve found that do not have any Soy in their products are ISOWhey and ProteinFactory. I know where I’m buying my protein now!


Fast digesting, high BV Whey protein in the morning and post-workout for a quick protein hit. Slow digesting Casein protein before bed and in between meals. AND NO SOY PROTEIN IN BETWEEN! ISOWhey and ProteinFactory all the whey! ;-)


Bitshifting / Bitmasking tutorial

Warming up…

So pretty much I had a few mates from uni who were having trouble with this unit called Operating Systems Programming. I had another friend of mine who did the unit back in 2011 and had heard (and seen) some of the nasty-ish stuff that is required. Mainly — this is bitshifting / bitmasking. Having never done the unit myself (I did a B. Computing, whereas OSP is a core unit of B. ICT (Information Communications Technology) and having never used bitwise operations either (in todays software environments…unless you’re writing really low level stuff, I can’t see it being used), I wasn’t much help at first. In saying that, I was legitimately curious about these bitwise operations. I’d looked briefly at them before, but not to the extent that I’d even be able to fully understand the OSP assignment code, let alone write it myself (using bitwise operations).

So I decided to investigate a little into this stuff and put my findings into a short tutorial. Sorry to all the OSP guys but I’m not actually going to release any of the assignment code here, nor is this scenario that of the assignment. In saying that, this tutorial should still be useful if you can’t get your head around this C bitwise operations. Let’s start.

Our Scenario

Let’s say that we’re going to start programming WoW. Don’t know what that is? Sorry, you’re not enough of a nerd to learn C. I suggest maybe learning Visual Basic or English. For my fellow nobles of Azeroth who remain, we’re basically going to use bitwise operations to retrieve some information about a hypothetical WoW player – their race and their class

Let’s code!

	#include <stdio.h>

	char* race[] = {"Orc", "Human"};			        
        //two options - needs one bit

	char* class[] = {"Warrior", "Hunter", "Mage", "Rogue"};		
        //four options - needs two bits


This is actually painful to write after using Java and C#, but let’s just abandon the noble principles of OOP for now and go back to old school arrays. The two arrays above are going to store the race of the player and their class. Nothing fancy yet (though if you’re scared off at this point – maybe brush up on your C/C++)

Before we start bitshifting, we all know what binary is – right? If not, wiki it and come back in a few years. So let’s start thinking about how we’re going to organize our bits. For this simple scenario, we’re only storing the class and the race of the player. The race is either a 0 or 1 (2 element array), so we only need a single bit for it. The class has 4 elements (double), so we need 2 bits for it. 3 bits total.

The order of our bits is important, since we’re going to be moving them around. For this scenario, lets assume that this is our byte:

0000 00 | 00

Only the bold bits will be used in our program. The single leftmost bit will store our race (0/1) and the last two will store our class. Remember the order – it’s important.

	unsigned const int ORC_WARRIOR = 0x00;    
        //hex zero - all bits turned off. This will be an Orc Warrior

	unsigned const int ORC_HUNTER = 0x01;     
        //hex one - zero (orc) and one (hunter)

	unsigned const int ORC_MAGE = 0x02;       
        //hex two - zero (orc) and two (mage)

	unsigned const int ORC_ROGUE = 0x03;      
        //hex three - zero (orc) and three (mage)

	unsigned const int HUMAN_WARRIOR = 0x04;  
        //hex four - only first bit turned on. So it will be race[1] and class[0]

	unsigned const int HUMAN_HUNTER = 0x05;   
	unsigned const int HUMAN_MAGE = 0x06;
	unsigned const int HUMAN_ROGUE = 0x07;

Above, we’re pretty much defining specs for our different race/class combinations. Notice that we have the orcs occurring first (finishing at 3) and
the humans occuring next (starting at 4). What’s the highest value we can store in the last 2 bits? 3! It’s not by accident – to store 4, the third bit
must be set to 1, which indicates that our race is a human (pass 1 to the race array).

	int main (int argc, const char * argv[]) {
		unsigned int Player = ORC_MAGE;

Now we’ve got an integer that represents our player. We’ve defined him as an orc mage. But how can we retrieve this information later? Really, all that we’ve stored about him is the number 6. This is where bit manipulations come into play. Let’s take a look at a function we can use for retrieving a given bit.

		Note: For academic integrity, this is just pseudocode. 
Write your own source code

		FUNCTION GetBit(byte, bitNo)

WTF is that? Yeah, that’s what I thought. Compared to nice, pragmatic OOP, this is pretty much jibberish. But it doesn’t have to be read that way. byte pretty much accepts a full, unsigned integer that let’s say consists of 8 bits. bitNo represents the index of (0-7) of the bit that you want to retrieve. If you look at our return statement, we’re pretty much doing two things.

First, we’re setting up a new byte with the value of one and shifting its bits to the left by bitNo. Come again? Let’s set up a new byte with the value of 1, which looks like this: 0000 0001. Then we shift its bits left, by the value of bitNo. Let’s say that bitNo is equal to 3. So we shift our bits left by 3 places, resulting in: 0000 1000.

Next, we perform a binary AND of the result with byte. So if we did this (pseudo): getBit(0110 1000, 3); we could be ANDING 0110 1000 with 0000 1000. What’s the result of this AND? The only bit that will be turned on is the bit at element bitNo, if it was turned on in byte. So it returns the value of an on bit at position bitNo. Otherwise, no bits will be turned on – so it returns 0, basically.

Oh! Just in case you don’t know, the << operator moves bits to the left by a defined number of spaces and >> moves bits to the right by a defined number of spaces. So you can do stuff like:

	int x = y << 2; 
        //x contains the value of y, with its bits pushed 
        //2 positions to the left. 

	int a = b >> 2; 
        //a contains the value of b, with its bits pushed 
        //2 positions to the right. 

And to perform a binary AND:

       int x = y & z; 
       //x equals y BINARY-AND z

So we can do stuff like this:

	//Get the value of the race bit using the getBit(...) trick
	int raceValue = getBit(Player, 2);
	printf("Value of race bit: \n");
	printf("%d\n", raceValue);
	//Print the race
	printf("Race of Player: \n\n");
	int raceIndex = Player >> 2; 		     
        //shift all the bits right two places to only access the
	//last bit (we're only using 3 bits at any one time here)

Getting the value of the race was actually pretty easy once you get your head around the shifting, since it was the leftmost bit. But what about getting the class, since its on the right and contains more bits? Basically, if we could turn off that bit on the left that represents the race, then the remaining amount would be that which represents the class. So how can we turn off a defined bit? It’s a bit tricky (haha, very funny), but here’s how to do it:

	Note: In the interest of academic integrity, 
        pseudocode is provided instead of actual source code for this function

                          AGAINST INDEX


The first thing we do is to raise 2 to the power of bitNo. This means that if you want to turn off element 0, we take 20=1. Element 1 is 21=2. Element 2 is 22 = 4. Element 3 is 23 = 8 and so on. This gives us the value of the bit in question, which is what we need to produce a byte from it.

On the next line, we create a new byte called newByte that is the result of a one’s compliment against 2bitNo. This basically means that all of the bits are swapped – 0’s becomes 1’s and vica versa. So if you did this: turnOffBit(1111 1111, 3); you’d get:

	2 * 2 * 2 = 8
	temporary byte = 0000 1000 (8 in decimal)
	newByte = 1111 0111 (temporary byte inversed)

	1111 1111 AND 
	1111 0111 =

	1111 0111 (with bit at index 3 turned off!)

And the last bit:

	//Print the Class
	printf("\nClass of Player bits 2 and 3): \n\n");
	int classByte = turnOffBit(Player, 2);
	printf(class[ classByte ]);

Hopefully this was written well enough to explain the basics of bit operations in C. Best of luck!


  1. en.wikipedia.org/wiki/Bitshift
  2. http://en.wikipedia.org/wiki/Bitwise_operations_in_C
  3. http://www.eskimo.com/~scs/cclass/int/sx4ab.html
  4. http://stackoverflow.com/questions/2717725/how-do-you-turn-off-a-specific-bit-in-a-bit-mask