Skip to main content
gamedev.net
🔒 Locked

Suggestions for program...

Started by philscott 3 replies 1k views
Original Post
philscott
philscott
I''ve got a really cool program written in BASIC and I would like some suggestions on how to improve the code. 10 PRINT "PHIL IS SKILL" 20 GOTO 10
JuNC
JuNC
Welll... hardcoding the string is probably a bad idea, you should make it a constant variable (or whatever is equivalent in BASIC). Also, PRINT is usually pretty inefficient, I would suggest reimplementing it in inline assembly (or as a separate C dll if your BASIC system won''t allow that).
Fruny
Fruny
Trivial improvement - make it so the printed string is the source code of the program itself - no cheating and printing it from a file though

Documents [ GDNet | MSDN | STL | OpenGL | Formats | RTFM | Asking Smart Questions ]
C++ Stuff [ MinGW | Loki | SDL | Boost. | STLport | FLTK | ACCU Recommended Books ]
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan
intransigent-seal
intransigent-seal
well, you know GOTO is evil (), so:
10 REPEAT
20 PRINT "hello world"
30 UNTIL FALSE
John B

[edited by - JohnBSmall on November 9, 2002 12:21:58 PM]
The best thing about the internet is the way people with no experience or qualifications can pretend to be completely superior to other people who have no experience or qualifications.
CodeJunkie
CodeJunkie
10 rem My Program's Better because I'm Smart
20 gosub 40
30 end
40 print "I wonder how long this will Run??"
50 goto 20

[edit]
oops
[/edit]

[edited by - CodeJunkie on November 9, 2002 12:37:46 PM]

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.