Advertisement
Jousway

Vintage VS Modern Basic

Sep 14th, 2016
231
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
QBasic 0.87 KB | None | 0 0
  1. --------------- Vintage Basic ---------------
  2.  
  3. 10 GOTO 2000
  4. 20 INPUT "input a number: ";a
  5. 30 PRINT "the table of the number",a,"is:"
  6. 40 FOR i = 1 TO 10
  7. 50  PRINT a*i
  8. 60 NEXT i
  9. 70 INPUT "press enter";b$
  10. 80 GOTO 2000
  11.  
  12. 2000 PRINT "vintage basic testing"
  13. 2010 PRINT "1) table of N"
  14. 2020 PRINT "0) Quit"
  15. 2030 INPUT "pick a program";p
  16. 2040 IF p = 1 THEN GOTO 20
  17. 2050 IF p = 0 THEN GOTO 3000
  18. 2060 GOTO 2000
  19.  
  20. 3000 END
  21.  
  22. --------------- Modern Basic ---------------
  23.  
  24. SUB start()
  25.     CLS
  26.     PRINT "modern basic testing"
  27.     PRINT "1) table of N"
  28.     PRINT ""
  29.     PRINT "0) Quit"
  30.     INPUT "pick a program",p
  31.     IF p = 1 THEN
  32.         table()
  33.     END IF
  34.     IF p = 0 THEN
  35.         CLS
  36.         quit
  37.     ELSE
  38.         start()
  39.     END IF
  40. END SUB
  41.  
  42. SUB table()
  43.     CLS
  44.     INPUT "input a number: ",a
  45.     PRINT "the table of ",a," is:"
  46.     FOR i = 1 TO 10
  47.         PRINT i*a
  48.     NEXT i
  49.     INPUT "press enter",b$
  50.     start()
  51. END SUB
  52.  
  53. start()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement