Advertisement
Guest User

Idiom Generator in QB64

a guest
Jun 10th, 2019
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
QBasic 1.46 KB | None | 0 0
  1. OPTION BASE 1 'I start all my arrays at 1
  2. CLS 'clear the screen
  3. RANDOMIZE TIMER 'shake up the dice
  4.  
  5.  
  6. DIM prefixes(27) AS STRING 'dimension an array to fit the data set
  7. RESTORE prefixes 'set pointer to the start of the first dataset
  8. FOR count = 1 TO 27
  9.     READ prefixes(count) 'this takes the data from the set and copies it to slots in the array
  10. NEXT count 'since only one is copied per loop, it must be done 27 times in a row
  11.  
  12. count = 1 'reset counter
  13.  
  14. DIM suffixes(28) AS STRING
  15. RESTORE suffixes 'set the pointer to the start of the second dataset
  16. FOR count = 1 TO 28
  17.     READ suffixes(count) 'see above
  18. NEXT count 'ditto
  19.  
  20. count = 1
  21. FOR count = 1 TO 5
  22.     PRINT prefixes(INT(RND * 27) + 1) + " " + suffixes(INT(RND * 28) + 1)
  23. NEXT
  24.  
  25.  
  26. END 'DATA must be placed after the end of the program (since its a seperate memory thing?)
  27.  
  28. prefixes: 'there are 27
  29. DATA "bitter","fan the","guilty","in for the","jump","mean","once in a","raise","take with a","under","wicked","X","you can say that","balls","clam","dressed","elephant","home","kicking","cat","nerves","paint","quick","straw","vouch","zero","stop"
  30.  
  31. suffixes: 'there are 28
  32. DATA "to the wall","up","to the nines","in the room","away from home","and screaming","out of the bag","of steel","with a broad brush","on the uptake","that broke the camel's back","for","in on","pill","flames","pleasure","home","kill","ship","streak","paint","the bar","grain of salt","the influince","tongue","factor","again","stop"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement