News for hackers. Stuff that matters.
Re:Show HN: Space Shooter in QBasic by jhallenworld on Monday February 01, 2016 @07:12PM (#11016753)
Does it work in http://www.qb64.net/ ?
Re:Show HN: Space Shooter in QBasic by versteegen on Tuesday February 02, 2016 @12:06AM (#11017711)
I got it running with FreeBasic with a few changes: several arrays were not declared (does QB just guess the correct size? Resize them as they are indexed??), and I had to comment out the PLAY commands, which FB doesn't support.

http://pastebin.com/QrnvyVAH

Turns out it runs insanely fast, there's no speed control. It's also really hard to see in a tiny window.

Re:Show HN: Space Shooter in QBasic by pjmlp on Tuesday February 02, 2016 @02:11AM (#11018020)
If I remember correctly you always needed to do a DIM or REDIM at some point before really using them.

But it is so long time ago and I never really used QBasic, by the time it came out I was already into Turbo Pascal, leaving Turbo Basic behind.

I did however spend long evenings trying to understand it, as QBasic was one of the first languages I tried to implement a compiler for.

Re:Show HN: Space Shooter in QBasic by versteegen on Tuesday February 02, 2016 @01:20PM (#11021240)
This code didn't DIM some of those arrays at all, and others were DIMed as integers instead of integer arrays! IIRC QB allows variables with different types to have exactly the same name, so I guess that's equivalent to not DIMing any of them.

I think I might remember something about a default size for undeclared arrays...

Re:Show HN: Space Shooter in QBasic by Jean-Philipe on Tuesday February 02, 2016 @04:32AM (#11018467)
Cool!

By the way: The PLAY command was acting as a pause hack, to limit the speed. It would just block the loop for a few milliseconds. Not sure there's an alternative, I think SLEEP was only for seconds...

Re:Show HN: Space Shooter in QBasic by donatj on Monday February 01, 2016 @08:56PM (#11017215)
I recently discovered this myself and was able to run the vast majority of my games I wrote as a kid except for the ones that used sound or machine code.