Category Archive: Announce

Grrr source code, including Invaders

As you may have noticed, there has been very little activity here from me in recent months.

This is partly because my full time work does not use nor need PowerShell and my free time has become more precious.

Playing with PS1 has been fun and I’ve learned a lot, but ultimately, it’s just a toy to me, and there comes a time when you must put your toys away — one might argue that, at nearly 40, I should have put my toys away long ago :-)

Now, I’ve been inundated with literally 3 requests for the source code to Grrr, the snapin-based framework behind Big Invaders, so here it is:

Grrr source code

Like the rest of the stuff here, it’s released under the creative commons license.

So long, and thanks for all the fish.

Grrr 1.1 and Big Invaders

So I’ve been spending a bit of time getting to grips with Cmdlets and resurrecting interest in PSInvaders using Grrr and now have something to post.

Grrr 1.1 is now Cmdlet based and comes as a Snap-In. The most obvious benefit from this is performance, as I can now present a playable version of PowerShell Big Invaders.

BigInvaders 1.1 in play

BigInvaders is one of the demo PowerShell scripts that makes use of the Grrr.

Download this prerelease version 1.1 of the Grrr snap-in.

Update: this should now install on Vista - thanks to Chris Warwick for pointing out some issues

There’s no installer (yet) so to get going, follow this instructions:

Unzip the archive where you want to use it and CD to the top level director where the README file is.

Type: ./installgrrr.ps1 -r

The -r switch forces it to re-register the snap-in if a (possibly) older version exists. It then adds the snap-in to the current shell.

From here you can CD into the demos directory and run any of the scripts. Each one shows a feature of Grrr, but perhaps the most interesting is in the biginvaders directory.

To run BigInvaders, you need to have a very large console. To achieve this you probably need to set the font size of your console window to 6×8.

If you want sound, you need to install DirectX DirectSound. More on why later.

It should work without, silently, but this hasn’t had much testing as all my XP boxes have it installed :-) If there are exceptions, start it with the -nosound switch.

Assuming all is well, type ./biginvaders.ps1 and you should see this title screen:

BigInvaders 1.1 intro screen

Hit ESC to quit or Space to play. In play, Space fires a missile and arrow keys move left and right. Hit F to toggle FPS display in the top-righthand corner.

The target FPS is 33. I achieve this easily on my MacPro, and my wife’s Dell (a core 1 duo, 1.66ghz) also just manages.

There are still a few snags to iron out here and I want to add proper PowerShell help and an installer, but it is functional.

I’ve learned a lot about C#, PowerShell SDK and .NET these last weeks and will write about my findings over the next days. It’s not all been rosy.

I’ll also be writing about the features of Grrr, and where I want to go with it.

That’s it for now.

Grrr, Cmdlets and PSInvaders revival

Still not much happening here, again partly due to being busy with other things, and also the final arrival of my Wii.

Anyways, I’ve almost completed the transition of Grrr to Cmdlets and it’s looking very promising as this screen shot shows (I get 50fps with only 20% cpu load doing this):

Big Invaders

I intend to redo the original PSInvaders using Grrr, with more authentic gameplay and original graphics.

The scrolling tilemap support is looking good, so games like Gauntlet, Scramble and Super Mario Brothers should be possible… all scripted in PowerShell.

So apologies for the low post volume recently and please do watch this space.

Slow week

Not much happening here on the blog this week as I’ve been a bit busy with other things and also on some non-trivial PowerShell projects:

  • A snap-in version of Grrr - I realised that PowerShell alone is just too slow for it to be useful, so thought I’d have a go at doing it all as cmdlets in a snap-in. It’s fairly easy, but I’m not there yet.
  • In trying to understand the grammar of PowerShell better (the documentation is not so great, and Bruce hasn’t printed his book yet), I’ve started to write an interpreter in Java. I’ve got a more or less complete AST, and a prototype interpreter, but it’s slow going (well, I only started 4 days ago, and it’s in my spare time).

Watch this space.

Updated get-bufferhtml

A while back, I posted an article: Console screen grabs in html.

I fixed some bugs and added a couple of new features to the script get-bufferhtml.ps1, and have updated the article with examples.

Enjoy!

Moving to WordPress

I’ve been having problems with RapidWeaver as my blogging software, not limited to RSS links being broken, and no previous/next links for the blog, so I’ve decided to move it to WordPress.

It looks like it’s all ok now, but if you see anything broken, please let me know.

The blog’s RSS feed is also redirected, but if your RSS doesn’t understand redirects (http 30x) you can resubscribe here (atom) or here (rss).

Unfortunately, I was unable to move all the comments people left to WordPress, but I do still have them.

Happy New Year

Just over half a day left of 2006 here in London, the weather is cold, windy and wet, the coffee is on, and I write my first post!

I’ve been using PowerShell (abbreviated to PS1 from now on) since it was RTW (released to web) some time at the end of November 2006. A few of my colleagues also starting playing with it, and as some of us were unix/Mac people, we set about mocking it :-).

Speaking for myself, I was quite impressed but less so with the documentation and other online resources. I’ve also become less and less impressed with it over the last several weeks, but then it’s quite common for the shine to wear off new toys.

First Impressions

A pipeline - yay!
Scripting .NET and COM
Looks like it might have closures and rubyesque features.

Second Impressions

It didn’t have have closures after all.
Very very slow
snip

Space Invaders

Anyway, this didn’t stop me trying to do inappropriate and silly things with it. e.g., getting the MS Agent (Merlin etc.) to insult you.

It’s always been a pet hobby of mine to try to write Space Invaders in any new language I learn. Usually it just goes as far as writing something that moves the alien hoard in an authentic way, as you don’t really get input event support in languages like COBOL or CMD.EXE batch language.

Joy! PS1 gives you access to the host console via $host.ui.rawui, so the work began.

Between myself and 3 colleagues, we did get a perfectly playable version of Space Invaders, and I plan to put it up here in a future post.

That’s it for now. Happy PS1 scripting in 2007!