4 ms·
Does it work in http://www.qb64.net/ http://www.qb64.net/ ?
by jhallenworld 11y ago
Does it work in http://www.qb64.net/ http://www.qb64.net/ ?
- donatj 11y agoI 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.
- versteegen 11y agoI 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 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.
- pjmlp 11y agoIf 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.
- versteegen 11y agoThis 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...
- Jean-Philipe 11y agoCool! 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...