« 4 years Why you should stop using XP »

Boring code

Posted by Simon Welsh | 4 May 2010 | Comments (1)

Every so often, I get bored of code. When this happens during competitions, I have to make it interesting. Last time this happened, I decided to add a dragon, COMP102 students and a worm hole. (I totally stole the idea for a dragon and COMP102 student fromĀ this, the wormhole came from the problem).

Here's an extract, cause the rest of the code is sadly lacking in amusingness.

#define eat push
#define hungry size
#define burn front
#define digest pop

...
	queue<coord> dragon;
...
		dragon.eat(c);
		while(dragon.hungry()) {
			c = dragon.burn();
			dragon.digest();
			...
				dragon.eat(comp102student);
			...
				dragon.eat(comp102student);
			...
				dragon.eat(comp102student);
			...
				dragon.eat(comp102student);
			...
				dragon.eat(white_hole);
			...
				dragon.eat(black_hole);
...

Yay for #defines and STL whoring :)


Share on FaceBook

Trackbacks

None
Trackback URL: http://simon.geek.nz/Trackbacks/add/1225

Post your comment

Sign in with Twitter

Comments

  • Hehe, you said whoring.

    Posted by Caitlin, 14/08/2012 11:46am (9 months ago)

RSS feed for comments on this page | RSS feed for all comments