Home

Snake Game Update

Posted by patorjk | Web Apps | Friday 24 December 2010 4:51 am

You can play snake in the box below.

I decided to redo the internals of my JavaScript Snake Game since it was old and in dire need of an update. I thought about using the canvas element, but since it still has its issues with IE and excanvas can be a little slow, I decided to stick with using divs for the drawing blocks. The game is probably not the best it could be, but it’s definitely better than where it was at. If you’re interested in the inner workings I have the source available here.

Documentation Page Example

For this update I also decided to experiment a little with YUI Doc, which is a tool that generates documentation for source code. It caught my eye since it creates beautiful looking documentation and it’s language agnostic, so it could possibly be used for all sorts of projects. The documentation for this Snake game probably isn’t too useful, but on larger projects I could definitely see this kind of thing coming in handy.

The only negative to the tool was that it didn’t seem well documented itself. I found myself somewhat frustrated in debugging some of the issues I had using it, and I ended up having to do a little hand editing of the output files to remove YUI Library labels. Other than that though, it was a pretty cool tool.

ASCII Art Code Comments

Posted by patorjk | Web Apps | Thursday 2 December 2010 12:24 am

Nick Kaye emailed me yesterday suggesting I add a feature to the Text ASCII Art Generator program which would allow for the output to be formatted in the form of a C-style programming comment. He even offered to write the code patch himself.

I thought the idea was really cool, and took him up on his offer. Anyway, the new feature is under the “More Options” link in the TAAG interface. Once it’s turned on, you’ll get output that’s formatted in the form of a programming comment. Here is an example:

/***
 *                      .___
 *      ____   ____   __| _/ ____
 *    _/ ___\ /  _ \ / __ |_/ __ \
 *    \  \___(  <_> ) /_/ |\  ___/
 *     \___  >\____/\____ | \___  >
 *         \/            \/     \/
 */

If anyone has any issues or additional suggestions let me know. And thanks again to Nick!