Macromancer’s Spellbook: Using Macros to Stay DRY

It is sometimes hard to see past the thick haze of caution surrounding the use of C Preprocessor macros in your code. Indeed, the dangers of Macromancy are well-stated in many corners of the internet. You would do well to heed them. However, there are times where a judicious use of macros can help reduce duplication in … Continue reading Macromancer’s Spellbook: Using Macros to Stay DRY

How to Implement a Grid Movement Mechanic for Your Tile-based Game

"Hey, you! You're sliding all over the place! STOP! ", you project your thoughts violently at the character sliding around your screen, getting caught on the corner of tiles, other objects, your pride. You stand up out of your computer chair with a sigh, dreaming about the grid movement mechanics in old-school Pokemon and Zelda … Continue reading How to Implement a Grid Movement Mechanic for Your Tile-based Game

Pass by Reference vs Pass by Value in C++

I work in an undergraduate T.A. role for a computer science sequence that teaches students programming concepts and data structures in C++. In each course, students have to take a proficiency demo -- a closed book, closed notes, live coding exam where they must solve a technical interview-flavored question with a given data structure. For … Continue reading Pass by Reference vs Pass by Value in C++