Advertisement
Shaun_B

Exciting random number generator in CBM BASIC

Dec 18th, 2011
590
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. 0 print chr$(147) ;: a$ = "" : b$ = a$ : c = 0
  2. 1 print "this app will generate a random number for you!"
  3. 2 print "it negates the need for you to think of your own"
  4. 3 print "random numbers. please enter highest number"
  5. 4 print "that you will need this time."
  6. 5 get a$ : if a$ = "" then goto 5
  7. 6 if a$=chr$(13) then goto 9
  8. 7 if a$ < "0" or a$ > "9" then goto 5
  9. 8 print a$ ;: b$=b$+a$ : goto 5
  10. 9 let c = val(b$):let c = c+1
  11. 10 print a$+a$;"the random number generated is..."
  12. 11 print int(c*rnd(1))
  13. 12 print "would you like to generate another random number?"
  14. 13 print "(y/n)"
  15. 14 get a$ : if a$ = "" then goto 14
  16. 15 if a$ = "y" then clr : run
  17. 16 if a$ = "n" then end
  18. 17 goto 14
  19. 2011 rem (c) mmxi donkeysoft
  20. 2012 rem *** written in commodore (microsoft) basic
  21. 2013 rem *** exciting random number generator!
  22. 2014 rem *** or as random as a number generator can get in basic
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement