开发者

Two questions for old programmers [closed]

Closed. This question is opinion-based. It is not currently accepting answers.

Wa开发者_如何学运维nt to improve this question? Update the question so it can be answered with facts and citations by editing this post.

Closed 9 years ago.

Improve this question

So I've been using QBASIC64 today... for old school's sake.

I was wondering:

a) What is the most complex QBASIC code you have ever written was

and

b) What is the most useful code you have written

(examples would be nice but not imperative ^_^ - and this is Community Wiki and just for fun)


GOTO used to be so easy those days :-)


Although I never used QBasic (I managed to skip the generation of machines that had it) I did write a Z80 assembler in its predecessor, GWBasic, together with support code for some hardware to transfer the resulting machine code to my test platform. It most certainly qualified as complex, as well as being very messy and slow, but that's because I didn't know better (having not taken any data structures and algorithms classes at that point).


Most complex: Huffman coder using a string to store the tree. I don't think i got it working.

Most useful: Palace chat maze editor/generator.


I never really got so far with QBasic. This would be because I'm not an old programmer. Most I ever did, (fitting both A) and B) ) was make a program the read a number from keyboard, and then calculated 10% of it, pringitng that to screen.

This must have been in 2000, as 10% gst was being introduced in australia. That makes me 9 years old. I remember spending like 6 months looking for a computer with QBasic on it.

Fond memories, of the, not so, distant past


Most Useful, and probably most complex: I wrote a quizzer program in QBasic that had mouse support, graphical buttons you could click, etc. It also used a generic file format so you could write new questions and load them in if you wanted to. The code is online if you are interested, although sadly the associated image / data / etc files are lost to time: http://code.google.com/p/justinethier/source/browse/trunk/qbasic_quizzer/project.bas


answer for both a and b: a program where the user would enter the string name and fret number on a guitar and the program would output which note the fret is. BTW, I love qbasic because its simplicity makes it fun!


QBasic was my first experience with programming. I was nine-years old (fourth grade) and we had a 386DX with MS-DOS and Windows 3.1.

I remember having fun hacking the code for Nibbler and Gorillas changing colors and constants and such.

So the most useful and complex program I made was a menu driven application which quizzed the user on math problems: there were ascending numeric levels of difficulty the user could choose from and I remember literally hardcoding 100 arithmetic problems checking the users response and telling them whether they got it wrong or not.

Not sure if I still have that code laying around, I think I might, I'll check tonight and post if I find it!

...alright! I found some stuff. This snippet is part of a file named "TEST1.BAS" and looks like an early version of the program described above. I believe I had a more complete version but it was lost when our hard drive crashed and we weren't able to recover all files.

CLS
PRINT
PRINT "     menu"
PRINT "--------------"
PRINT "1. level 1"
PRINT "2. level 2"
PRINT "3. level 3"
PRINT "4. level 4"
PRINT "5. level 5"
PRINT "6. level 6"
PRINT "7. level 7"
PRINT "8. level 8"
PRINT "9. level 9"
PRINT "10. level 10"
PRINT "11. OTHER"
PRINT
INPUT "Your selection: ", choice%
PRINT

IF choice% = 1 THEN
CLS
DO
   INPUT "what is 4 + 4 ? ", num
LOOP UNTIL num = 8
PRINT
PRINT "correct"

DO
   INPUT "what is 8 - 6 ? ", num
LOOP UNTIL num = 2
PRINT
PRINT "correct"

DO
   INPUT "what is 8 + 7 ? ", num
LOOP UNTIL num = 15
PRINT
PRINT "correct"

DO
   INPUT "what is 9 - 4 ? ", num
LOOP UNTIL num = 5
PRINT
PRINT "correct"

DO
   INPUT "what is 6 + 5 ? ", num
LOOP UNTIL num = 11
PRINT
PRINT "correct"
END IF

IF choice% = 2 THEN
CLS
DO
   INPUT "what is 11 + 6 ? ", num
LOOP UNTIL num = 17
PRINT
PRINT "correct"

DO
   INPUT "what is 21 - 5 ? ", num
LOOP UNTIL num = 16
PRINT
PRINT "correct"

DO
   INPUT "what is 2 * 2 ? ", num
LOOP UNTIL num = 4
PRINT
PRINT "correct"

DO
   INPUT "what is 14 + 8 ? ", num
LOOP UNTIL num = 22
PRINT
PRINT "correct"

DO
   INPUT "what is 17 - 5 ? ", num
LOOP UNTIL num = 12
PRINT
PRINT "correct"

END IF

IF choice% = 3 THEN

END IF

IF choice% = 4 THEN

END IF

IF choice% = 5 THEN

END IF

IF choice% = 6 THEN

END IF

IF choice% = 7 THEN

END IF

IF choice% = 8 THEN

END IF

IF choice% = 9 THEN

END IF

IF choice% = 10 THEN

END IF
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜