Original Post
🔒 Locked
Suggestions for program...
Advertisement
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).
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 ]
Documents [ GDNet | MSDN | STL | OpenGL | Formats | RTFM | Asking Smart Questions ]
C++ Stuff [ MinGW | Loki | SDL | Boost. | STLport | FLTK | ACCU Recommended Books ]
well, you know GOTO is evil (
), so:
[edited by - JohnBSmall on November 9, 2002 12:21:58 PM]
10 REPEATJohn B
20 PRINT "hello world"
30 UNTIL FALSE
[edited by - JohnBSmall on November 9, 2002 12:21:58 PM]
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]
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.
Advertisement