3 ms·
This is very, very cool. Speaking as someone who also wrote QBASIC games as a child, this evokes sharp pangs of nostalgia. I happen to have an old QBASIC book
by doktrin 14y ago
This is very, very cool. Speaking as someone who also wrote QBASIC games as a child, this evokes sharp pangs of nostalgia.
I happen to have an old QBASIC book (pub 1993) next to me, and was skimming through it shortly before coming across this article.
Random file I/O :
OPEN filename$ FOR RANDOM AS [#]filenumber LEN=recordlength
The book then goes on to provide helpful ways to guesstimate at the record length of a file on disk.
Drawing 2-D "staircases" diagonally in both directions across the screen :
PSET (0,0)
FOR p = 1 TO 25
LINE -STEP(25,0)
LINE -STEP(0,15)
NEXT p
PSET (639, 0)
FOR p = 1 TO 25
LINE -STEP(-25,0)
LINE -STEP(0,15)
NEXT p
END
Nostalgia, indeed :P
- tdicola 14y agoI remember buying this book as a kid http://www.amazon.com/Qbasic-Games-More-Fred-Sexton/dp/1565292316/ http://www.amazon.com/Qbasic-Games-More-Fred-Sexton/dp/15652... and literally poring over it for hours (before the internet, you had a lot of free time as a kid) to see how to make neat graphic effects and games.
- illuminated 14y agoJust realised, same indentation and no-end-character rules as python :) Although I've been writing qbasic back in the days and now writing python for fun, I've never realized this before...
- laumars 14y agoNearly every programming language follows those same indentation rules. And it's pretty common for languages not to have line termination characters too. What you're describing is pretty normal rather than a delightful coincidence.
- damncabbage 14y agoIt's not white-space sensitive; "FOR" is the start of the loop, and "NEXT p" is something approximating the end (a goto or sorts).
- nollidge 14y agoThe IDE forced those formatting conventions on you, but QBasic doesn't actually have any indentation rules at all, and IIRC that stuff was also configurable.
- nollidge 14y agoThis was my very first programming book: http://www.amazon.com/Absolute-Beginners-Guide-Qbasic-Perry/dp/0672303426/ref=sr_1_2?s=books&ie=UTF8&qid=1366207073&sr=1-2&keywords=absolute+beginner%27s+guide+to+qbasic http://www.amazon.com/Absolute-Beginners-Guide-Qbasic-Perry/... Amazon doesn't have the cover art, but it was very similar to this one: http://ecx.images-amazon.com/images/I/51VswbyvRHL._SL500_SS500_.jpg http://ecx.images-amazon.com/images/I/51VswbyvRHL._SL500_SS5...