Advertisement
anphu04

Pascal but in Lua

May 8th, 2018
278
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. local dem_pass = 1
  2. local dem_fail = 1
  3.  
  4. local ten = {
  5. all = {},
  6. passed = {},
  7. failed = {}
  8. }
  9. local cs = {}
  10. local cn = {}
  11.  
  12. ten.all = {'nibba', 'bitches', 'poods'}
  13. cs = {7,6,2}
  14. cn = {10,5,3}
  15.  
  16. for i = 1, #ten.all do
  17. if cs[i] >= 5 and cn[i] >= 5 then
  18. ten.passed[dem_pass] = ten.all[i]
  19. dem_pass = dem_pass + 1
  20. end
  21. if cs[i] < 5 and cn[i] < 3.5 then
  22. ten.failed[dem_fail] = ten.all[i]
  23. dem_fail = dem_fail + 1
  24. end
  25. end
  26.  
  27. print('PASSED')
  28. for i,v in pairs(ten.passed) do print(v) end
  29. print('FAILED')
  30. for i,v in pairs(ten.failed) do print(v) end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement