home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / euphoria / buzz.ex < prev    next >
Text File  |  1993-12-06  |  2KB  |  88 lines

  1.     -- Buzzword Generator
  2.     -- Add your own phrases!
  3.  
  4. constant leadins = {
  5. "Unfortunately",
  6. "In the final analysis,",
  7. "For all intents and purposes",
  8. "We may definitely conclude that",
  9. "Leading industry analysts agree that",
  10. "Therefore",
  11. "Without a doubt",
  12. "According to the National Enquirer,",
  13. "It is rumoured that"
  14. }
  15.  
  16. constant subjects = {
  17. "Bill Clinton",
  18. "shareware",
  19. "The North American Free Trade Deal",
  20. "C++",
  21. "IBM",
  22. "multimedia PCs",
  23. "local bus video",
  24. "fax modems",
  25. "Euphoria",
  26. "Rapid Deployment Software",
  27. "Bill Gates",
  28. "Microsoft",
  29. "the Pentium processor",
  30. "pen-based computing",
  31. "the promised land of 21st century computing",
  32. "RISC machines",
  33. "object-oriented technology",
  34. "case tools",
  35. "Windows",
  36. "lap top computers",
  37. "notebook computers"
  38. }
  39.  
  40. constant verbs = {
  41. "will no longer support",
  42. "can save",
  43. "will nibble away at the installed base of",
  44. "will be the downfall of",
  45. "will lead the way to",
  46. "will be like a cancerous growth in",
  47. "will destroy",
  48. "will make a mockery of",
  49. "will not be compatible with",
  50. "will be a great embarassment to"
  51. }
  52.  
  53. function buzz(integer n)
  54. -- generate a paragraph containing n sentences of pure nonsense
  55.     sequence paragraph
  56.  
  57.     paragraph = ""
  58.     for i = 1 to n do
  59.     paragraph = paragraph &
  60.             leadins [rand(length(leadins))]  & " " &
  61.             subjects[rand(length(subjects))] & " " &
  62.             verbs   [rand(length(verbs))]    & " " &
  63.             subjects[rand(length(subjects))] & ". "
  64.     end for
  65.     return paragraph
  66. end function
  67.  
  68. procedure display(sequence paragraph)
  69. -- neatly display a paragraph
  70.     integer column
  71.  
  72.     column = 1
  73.     for i = 1 to length(paragraph) do
  74.     puts(1, paragraph[i])
  75.     column = column + 1
  76.     if column > 65 and (paragraph[i] = ' ' or paragraph[i] = '-') then
  77.         puts(1, '\n')
  78.         column = 1
  79.     end if
  80.     end for
  81. end procedure
  82.  
  83. puts(1, "\n\t\tComputer Industry Forecast\n")
  84. puts(1, "\t\t--------------------------\n\n")
  85. display(buzz(8))
  86. puts(1, "\n\n")
  87.  
  88.