Posts Tagged ‘Java’

Old Code o’ Happiness

Wednesday, December 16th, 2009

Digging through my ancient email a few days ago, I found a lovely old program I wrote for a friend of mine.  He sent me a sporadic email along the lines of “Awesome/bizarre challenge: Program a 4d maze.”  So I did.

The up-to-date source code for this is long gone — I’ve made a feeble attempt to recover it using a java decompiler, to no avail — but the program stands well enough on its own.  If anyone wants to play around with it, I’ve helpfully uploaded it here; it works wherever Java does.  The .bat file should work for Windows users, and otherwise just go to the directory in a command line and type “java WalkerTester” (sans quotes, of course).

I feel like adding a note on the coordinates here.  After some amount of discussion, my mysterious unnamed friend and I decided to measure the coordinates in arbitrary units with no frame of reference, and to use a differently-named unit for each coordinate.  The coordinates are listed in the admittedly unconventional Z, Y, X, T order, and the #1 change I would like to make (and will, if I ever feel like it) is to change it to the rather less unconventional X, Y, Z, T order.  The maze is difficult enough as is.

If you decide to map a maze — well, good luck.  I found a flowchart worked serviceably, as did a T, Z grid of smaller X, Y grids.  It’s a thankless task, because while you can tweak the maze generation settings with “config,” you can’t use a specific seed or generally do anything to make a given maze persistent.  What can I say?  This was programmed on a lark and then abandoned when I got bored with it.

Have fun!

4dMaze

Ninite

Friday, December 11th, 2009

I ran across a lovely little app today called Ninite.  It made me cry a little.

How often have you found yourself on a new, new-ish, or refurbished computer with none of your must-have software on it?  It’s happened enough to me in the past several years to become something of a running annoyance.  I don’t know how many computers I’ve built, but I know I’ve gone through at least three main computers in as many years.  (I plan to stick with this one for a while, though.  It likes me.)

Ninite lets you pick from a fairly comprehensive list of open-source software, freeware, and shareware, and then it gives you a custom installer which will fetch the latest versions for your computer (in x64 if need be) and install them to the default locations — no babysitting, and absolutely no bundled crapware.  (I’ve mis-clicked or autopiloted myself into a couple of annoying toolbars in the past, despite a deep-seated and lasting loathing for most of them.  I’m not the only one, right?)  It’s pretty darned nifty.

Ninite doesn’t have all of the stuff I install — there’s no MediaMonkey, for instance, though Songbird has gotten good enough recently that I’ve considered switching.  Firefox will need to be immediately upgraded with your favorite addons.  And of course no computer of mine is complete without a version of Dungeon Crawl Stone Soup.  But really, it’s very pleasingly complete.

So which of these, I cannot hear you asking, do I use?  Well, seeing as how you’re so obviously interested, I will tell you in great detail.  Because I feel like it.  (For those of you who don’t care, this post is pretty much over for you unless you care what music I’m listening to.)

Starting from the top — browser of choice.  I use Chrome quite a bit, but for now Firefox is on top.  Chrome has a special place in my heart — it’s fast as blazes, for one thing — but it’s just not as customizeable as the Fox yet.  That’s going to change in a hurry now that Chrome has opened it’s extensions gallery, and I’m enormously pleased to have Chrome on my laptop now that it’s been released for Linux.  When running Portable Apps, Chrome is usually my go-to browser; its much faster and much more stable when running off my poor flash drive.

Pidgin is my messenger of choice.  I do sorely miss the cute little Gmail chat emoticons, but Pidgin’s everything else makes up for it.  I’ve poked Thunderbird a couple of times, but never seriously.

Current Music: Counting Crows, Accidentally In Love.  I thought this was a Dixie Chicks song for the longest time.  Also, I’m putting this in the middle just to annoy anyone who does care about what I’m listening to but not what apps I use.  No reason.  Just feeling contrary.

Media: Oh yes, VLC Media Player.  This is like the second or third thing I install on a computer, right after Firefox and maybe some antivirus software.  As awesome as VLC is for movies, though, I never use it for music — for that I prefer desperately need MediaMonkey or, failing that, Songbird.  Songbird has great potential, but I don’t really feel it’s quite gotten there yet.

Imaging: The Gimp.  I also mess with Inkscape enough that I’ll probably include it in any Ninite install, even though I do so little graphical work that I could probably make do with MS Paint indefinitely.

Documents: OpenOffice, Adobe, and maybe Foxit.  I actually prefer not to use Adobe for PDFs — not only is it bloatware, but it’s been known to have some pretty impressive security holes.  Sumatra PDF is usually my app of choice, but Foxit is a perfectly good alternative.

Security: Avast and Spybot.  I love both of those.  I’ve also started to mess with Malwarebytes, but I’m not yet very familiar with it.

Runtimes: Flash 10 (for other browsers, I will never need the IE version), JAVA, and .NET.  This falls under the “yay for annoyances I’ll never have to deal with now” category, because I never notice these missing until I need them.

File Sharing: uTorrent.  For Linux images, dontchaknow.

Other: I started using Dropbox about two days ago for backup purposes, and it’s pretty awesome.  Steam annoys me a great deal, but I do love me some TF2, so I’ll install it on any machine I expect to do gaming on.

Utilities: Launchy and Revo.  Revo is indispensible. (Do you know how many registry keys some programs leave behind?  Upwards of four thousand, in the case of some HP printer software I took off a laptop the other day.)  I just started using Launchy the other day. (I had a “hey let’s try out some software I’ve been eyeing forever” day)  But you know what?  Launchy’s pretty freakin’ cool.

Compression: 7-zip.  I used to use Winrar, but it’s shareware and 7-zip is open source.  And faster.  And supports more formats.  And doesn’t bloat my right-click menu as much.

Developer tools: I like Python, and I love Notepad++.  And . . . what’s this?  You mean I never have to dig through Sun’s website for the (right) JAVA SDK again?  That alone makes Ninite worth it.

All things considered, it’s been a pretty awesome day.

Wednesday, November 25th, 2009

For starters:

Reader ZeroInbox Zero-ish

At long last, I have home internet again.  And I had scarcely had it ten minutes when I received a very awesome invitation.

So far, it's one heck of a fun toy.  Check back with me when the rest of the Zosias dev-peeps get invitations.I do love me some Google Wave.

Plus it just so happens to be WoW’s anniversary.  If I’d gotten internet a day later, I would have missed out on a vanity pet, and I really like vanity pets.

And that’s not even all yet.

CRAV stands for Cops, Robbers, and Velociraptors.  There's a story there.Remember the other day, when I found a backup of the roguelike I’m working on now?  Well, as it turns out I found a backup of a roguelike I was working on years ago while digging through my inbox.  The great thing is that the two totally complement each other.  Most of my work on the above was on the front-end, the graphical pretty stuff.  Most of my work on the current one has been on the back end — character creation and the like.

I make no apologies for making 'neko' a race option.And since I was, even then, a great big fan of object-orientation and plentiful comments, methinks the two will get along quite nicely.  I like how each of them solves a bunch of problems I was avoiding in the other.

This isn’t even getting into the massive inspiration attack I’m suffering from regarding writing right now.  I think I’m gonna get on that.

Current music: The Truth, by The Spill Canvas, via Pandora.  Never heard of them.  I think I like them.

Ah, Pandora.  I’ve missed you so.

General Updatery

Saturday, November 21st, 2009

Hopefully it will come as no surprise that my NaNoWriMo push this year is about where it was when I mentioned I’d try for it.  I did allude to the insanity of the plan, after all.

What surprises me is the backup I found the other day.  I was looking through my flash drive backups for something else entirely, and found a backup of nothing but my programming folder — which was, it should be noted, the only significant casualty to my flash drive dying earlier this month.  It was an up-to-the-day backup, too.

This borders on being a religious experience.  I think Great Cthulhu wants me to continue work on that roguelike.

In other news, life is pretty awesome.  Things are looking up in general; my kid is doing great (save for some acid reflux and colic), and has begun occasionally sleeping as much as four hours at a stretch.  (This is actually better for Kat than for me, as I sleep like the dead.  She doesn’t.)

And, I now have a signed copy of The Gathering StormA friend of mine got it for me and shipped it down, for which I am now eternally indebted.  I’m reading the book now, and of course it’s great.  It also has me thinking.  See, Robert Jordan and Brandon Sanderson have a funny place in my writing/reading history: they’re the two writers who, more than any others, got me writing.

I’ve wanted to be a professional writer for a long, long time.  My earliest major writing project would have been when I was about ten, when I decided to write a sci-fi trilogy.  For years, that project (called Trikan) was the largest body of cohesive text I had managed to assemble.  (I’m looking it over now, and it’s . . . er, not as bad as I thought it would be, actually.  It’s also eight thousand words long.  Go, younger me.  But it’s still never seeing the light of day.)*

After Trikan, there was a lengthy period when I didn’t get any really significant writing done.  It was Robert Jordan’s The Wheel of Time that inspired me, the summer before I left for ASMSA, to get to work on a big project again.  That was when I started the project formerly known as The Storms of Heaven, and when I wrote most of the novella Ghost Ship — which astute readers (and people I’ve trapped in conversation long enough) may recognize as the work that formed the basis of Derelict.  If I hadn’t read The Wheel of Time then, there’s a pretty good chance these would never have gotten written.  It was a pretty influential work for me, to say the least.

Fast-forward to last year.  Having heard of Brandon Sanderson via his connection to The Wheel of Time, I picked up the books of his that were out at the time (Elantris and Mistborn: The Final Empire — I didn’t spring for The Well of Ascension until it came out in paperback.)  I read them.  I loved them.  And they inspired me to write again.  If I had to pick a single influence that got me started on Derelict in its full novelish glory, I would pick Brandon Sanderson.

I didn’t make these connections until recently — not as such, anyway.  The knowledge was there, in the back of my mind.  The reason it comes to mind now is because now I’m reading The Gathering Storm, which is by the two authors who have influenced and inspired me the most.

I wonder what’ll happen this time.

*Interestingly, the science vessel from which the characters of Trikan hail was named the Blue Star, and the salvage vessel from which the characters of Derelict hail is the Blue Star IV.  I was not aware of this, and to my knowledge wasn’t aware of it at the time that I wrote Ghost Ship.  Funny how the mind works.

Programming a roguelike

Friday, October 9th, 2009

The other day I decided to sit down and do some programming on a roguelike I’ve been meaning to make forever.  A roguelike, it should be noted, is generally not a small project; it is usually a multi-year thankless task in which you produce an indy game which, for free, will delight a relatively small audience.  But I enjoy programming, and so program a roguelike I might.  I also might decide, a week from now, not to work on it for a year or two.  My hobbies are funny like that.

It should be noted that time spent programming does not necessarily translate to time spent not writing.  If anything, my inspiration for Derelict is the highest it’s been in months since I started on this roguelike.  I think it helps to have another creative task to switch to from time to time.

So about the roguelike.  I’m aiming a little to the side of what roguelikes normally do.  In a typical roguelike, you descend into a random dungeon, fight monsters, and take their stuff, and that’s certainly planned for this one.  But I’m also planning on implementing a more social side of things.  You can have characters that never go into the dungeon at all, spending all their time building relationships and social skills on the surface.

The town, randomly generated when you roll your first character, remains persistent between characters — and your characters can improve it.  Found a mage’s guild, and wizard characters you create will have higher starting skills.  Spawn a heir and leave an inheritance, and you can play them as your next character.  Tick off the neighboring hobgoblin civilization, and they will do their level best to knock your town back to the stone age, destroying your hard-earned improvements unless you can stop them.

I’m aiming high, but that’s the point.  One of the advantages of roguelikes is that, without the need to create and maintain pretty graphics, you can create a game with incredible depth of play.  The best example of this is Dwarf Fortress, the one example (to my knowledge) of a roguelike that’s also a full-time paying job for its creator.  It’s also probably the closest thing to what I’m attempting here.

Don’t get your hopes up about this game.  Just because I’m starting it doesn’t mean I’ll finish it — it’s a lot of work, and I’ll keep doing it as long as I keep having fun.  That’s the beauty of doing it as a hobby as opposed to professionally.  (Derelict, for instance, necessitates my attention whether or not I’m having fun on a particular day, since I hope to someday go pro as a novelist.)

Current music: Mozart, various

Programming and Text Adventures

Wednesday, July 1st, 2009

I’ve loved computer programming for quite a while now.  I don’t know exactly how old I was when I first started programming in QBASIC, but I know there was a book on BASIC programming I checked out from my school library over and over again sometime in elementary school.  I didn’t have a way to write the programs in it at the time, but I loved reading it.  A couple of years later I started on QBASIC. (You don’t need line numbers?  The line numbers don’t have to be in order?)  Then I got a computer that wasn’t hopelessly out of date and went off to ASMSA, where I learned Java, my language of choice since (though Python is pretty neat).  Most of my class notes for the next couple of years included snippets of Java code.

So programming’s been part of my life for a while now.  Sadly, I’m kind of out of date.  Since I started serious work on my writing last year, a lot of my other hobbies have fallen by the wayside (notably not including gaming).  Programming’s one of these, and it kind of makes me sad sometimes.

I don’t know where I’m going with this.  (Am I allowed to admit that?)  But I have to wrap it up somehow, right?  Oh, hey, I remember now!  I’ve been being attacked by programming ideas again lately.  Mostly I’ve just been jotting them down for later reference, but a couple have stuck with me.  One of these has to do with Inform.

Inform is this lovely little programming language I discovered . . . four or five years ago at ASMSA.  (Whoah.  That long?)  In short, it’s a programming language designed for writing text adventures, and if you don’t know what those are I’m not going to spend a lot of time explaining them in this post.  It’s been a while since I played with Inform, and apparently there’s been a major upgrade to the language since I last did (as in, apparently the coding is intended to be in natural language now — whoah — but I’ve not yet toyed with the new version.)  Nonetheless, if I write a text adventure any time soon, it’ll be in Inform.  And I just might, because I have a nifty idea.

I love indie games.  I love books.  I’m a writer.  I’m a programmer.  Why not smash these together a bit?  I have an idea for a text adventure prequel to a duology that’s been kicking around the back of my head for a while now.  I think it’d be neat — the text adventure available free on this site, with some references back and forth between it and the duology so that neither is necessary to enjoy the other, but they enhance each other.

That’s about it for tonight.  I bid you all well.

Current Music: Creedence Clearwater Revival, Bad Moon Rising.  I’m listening to a Pandora station seeded on Johnny Cash right now.  I love Johnny Cash.