Demonstrate how to pick a random element from a list.




PROC Main()
  DEFINE PTR="CARD"
  PTR ARRAY a(7)
  BYTE i,index
 
  a(0)="Monday"
  a(1)="Tuesday"
  a(2)="Wednesday"
  a(3)="Thursday"
  a(4)="Friday"
  a(5)="Saturday"
  a(6)="Sunday"
 
  FOR i=1 TO 20
  DO
    index=Rand(7)
    PrintE(a(index))
  OD
RETURN