Advertisement
Guest User

Flight Information Program

a guest
Oct 18th, 2016
786
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.58 KB | None | 0 0
  1. -- Create random seed for random function
  2. math.randomseed(os.time())
  3.  
  4.  
  5. Airlines = {"Delta ", "Southwest ", "American Airlines", "United ", "JetBlue ", "Air Canada ", "Allegiant Air ", "British Airways " }
  6. Arrival = {"BNA", "TYS", "ATL", "ORD", "MIA", "LAX", "LAS", "MCO", "SFO", "JFK", "MSP", "STL", "DCA", "SEA", "DFW", "PHX", "CLT", "DEN", "PHL", "HNL"}
  7. Departure = {"BNA", "TYS", "ATL", "ORD", "MIA", "LAX", "LAS", "MCO", "SFO", "JFK", "MSP", "STL", "DCA", "SEA", "DFW", "PHX", "CLT", "DEN", "PHL", "HNL"}
  8. Flight = math.random(1000,2000)
  9. Flight2 = math.random(1000,2000)
  10. Flight3 = math.random(1000,2000)
  11. Flight4 = math.random(1000,2000)
  12. Flight5 = math.random(1000,2000)
  13. Flight6 = math.random(1000,2000)
  14. Flight7 = math.random(1000,2000)
  15. Flight8 = math.random(1000,2000)
  16. Gate = {"A", "B", "C"}
  17. Number = math.random(1,8)
  18. Number2 = math.random(1,8)
  19. Number3 = math.random(1,8)
  20. Number4 = math.random(1,8)
  21. Number5 = math.random(1,8)
  22. Number6 = math.random(1,8)
  23. Number7 = math.random(1,8)
  24. Number8 = math.random(1,8)
  25. Time = {"0000", "0100", "0200", "0300", "0400", "0500", "0600", "0700", "0800", "0900", "1000", "1100", "1200", "1300", "1400", "1500", "1600", "1700", "1800", "1900", "2000", "2100", "2200", "2300"}
  26. Status = {"On Time", "Delayed", "Cancelled"}
  27.  
  28. print("Airline Flight From Gate Time Status")
  29. print(" ")
  30.  
  31. print("".. Airlines[math.random(1,#Airlines)].. " " ..Flight .. " " .. Arrival[math.random(1,#Arrival)].. " " .. Gate[math.random(1,#Gate)] .. Number .. " " .. Time[math.random(1,#Time)] .. " " .. Status[math.random(1,#Status)] .. " " .. " ")
  32.  
  33. print("".. Airlines[math.random(1,#Airlines)].. " " ..Flight2 .. " " .. Arrival[math.random(1,#Arrival)].. " " .. Gate[math.random(1,#Gate)] .. Number2 .. " " .. Time[math.random(1,#Time)] .. " " .. Status[math.random(1,#Status)] .. " " .. " ")
  34.  
  35. print("".. Airlines[math.random(1,#Airlines)].. " " ..Flight3 .. " " .. Arrival[math.random(1,#Arrival)].. " " .. Gate[math.random(1,#Gate)] .. Number3 .. " " .. Time[math.random(1,#Time)] .. " " .. Status[math.random(1,#Status)] .. " " .. " ")
  36.  
  37. print("".. Airlines[math.random(1,#Airlines)].. " " ..Flight4 .. " " .. Arrival[math.random(1,#Arrival)].. " " .. Gate[math.random(1,#Gate)] .. Number4 .. " " .. Time[math.random(1,#Time)] .. " " .. Status[math.random(1,#Status)] .. " " .. " ")
  38.  
  39. print("".. Airlines[math.random(1,#Airlines)].. " " ..Flight5 .. " " .. Arrival[math.random(1,#Arrival)].. " " .. Gate[math.random(1,#Gate)] .. Number5 .. " " .. Time[math.random(1,#Time)] .. " " .. Status[math.random(1,#Status)] .. " " .. " ")
  40.  
  41. print("".. Airlines[math.random(1,#Airlines)].. " " ..Flight6 .. " " .. Arrival[math.random(1,#Arrival)].. " " .. Gate[math.random(1,#Gate)] .. Number6 .. " " .. Time[math.random(1,#Time)] .. " " .. Status[math.random(1,#Status)] .. " " .. " ")
  42.  
  43. print("".. Airlines[math.random(1,#Airlines)].. " " ..Flight7 .. " " .. Arrival[math.random(1,#Arrival)].. " " .. Gate[math.random(1,#Gate)] .. Number7 .. " " .. Time[math.random(1,#Time)] .. " " .. Status[math.random(1,#Status)] .. " " .. " ")
  44.  
  45. print("".. Airlines[math.random(1,#Airlines)].. " " ..Flight8 .. " " .. Arrival[math.random(1,#Arrival)].. " " .. Gate[math.random(1,#Gate)] .. Number8 .. " " .. Time[math.random(1,#Time)] .. " " .. Status[math.random(1,#Status)] .. " " .. " ")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement