xXm0dzXx

Test Homework Machine

Sep 26th, 2012
225
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. monthes = {
  2. 27,
  3. 16,
  4. 1,
  5. 0-4,
  6. 0-8,
  7. 0-8,
  8. 0-13,
  9. 0-16,
  10. 0-11,
  11. 0-2,
  12. 15,
  13. 26,
  14. }
  15.  
  16. first = monthes[1]
  17. first2 = monthes[2]
  18.  
  19. repeat
  20. answer = (first+first2)/2
  21. print("Answer is "..answer.."!")
  22. file = io.open("Awnswers","w")
  23. file:write("Answer 1 of "..first.." and "..first2.." is "..answer.."!")
  24.  
  25. for i=1,12 do
  26. if first == monthes[i] then
  27. first = monthes[i+1]
  28. first = monthes[i+2]
  29. elseif first == monthes[12] then
  30. print("All answers completed!")
  31. file:write("All answers completed!")
  32. file:close()
  33. done = true
  34. error()
  35. end
  36. end
  37. until done == true
Advertisement
Add Comment
Please, Sign In to add comment