Wednesday June 19, 2013
I've used a few macros to create polymorphic structs in the Empire game but the macros devised by Arun Kumar are worth a look.
If you are new to macros in C, it's worth remembering that they are substituted into the C source code in memory just before the compiler reads it. So while it's easy to define constants like #define PI 3.14159, you can do much more powerful stuff.
PS. I've updated Programming Challenge 71 with the input.zip file. I'll use a different set for the challenge marking.
Tuesday June 18, 2013
If you know Python then you might find Lobster of interest as the syntax appears very similar. I'm not sure whether the world really needs another programming language but it's open source and clearly there's been a lot of development done on it already.
It's the creation of developer Wouter van Oortmerssen and uses C++ 11 features (auto, lambda and range-for) so it needs either XCode 4.6 (on Mac) Visual Studio 2012 (free is ok) on Windows and a recent GCC (4.8 should do, maybe earlier).
Although it's comparable to Python, it runs several times faster according to the author and can be extended by C++. It has a high level interface to OpenGL and uses SDL 2.0 and FreeType and is really quite impressive.
Sunday June 16, 2013
I'll be back on other stuff this week but while this was fresh in my mind I wrote the first tutorial (Link now fixed) on developing iOS Apps with Xamarin Studio.
I use the term Xamarin Studio loosely as I have the Business edition which uses Visual Studio on Windows but in all the Xamarin tutorials, I will be using the Mac based Xamarin Studio which is free (fr Apps up to 32Kb in size).
You can develop any kind of App (including games) in C# with Xamarin Studio including games as every APi is supported.
Friday June 14, 2013
After a couple of days of intense reading and trying stuff out, it's finally starting to make sense. There's a kind of magic when I first got it to step through a program on my Windows PC and the iPhone simulator on the Mac steps forward.
Mind you there have been a few gotchas along the way. Nothing major but little things like making sure the important fields were filled in the properties or Visual Studio wouldn't connect to the Mac. Also be sure to Quit the iPhone Simulator to flip VS out of debug mode. Oh and occasionally the Xamarin Bonjour service hasn't started. It was set to manual and I've made it automatic with a delayed start.
But its worth it for the first time you see something new like getting the Apps settings working. That needed an XML file in a specially named folder and a property setting for Build Type to set it to Content. That was a very good feeling when I looked in the settings and there was My app with my settings fields. Oh and a recommendation for any other nascent Xamarin iPhone developers. Get the Bryan Costanich Apress book "Developing C# Apps for iPhone etc". It's very good.
My only gripe so far. It takes a minute to get debugging after pressing F5. Now whether thats my 100 MB network being a bit slow (it will get upgraded in a couple of days to gigabit) or just a longer build time I don't know. Is this normal?