Research portable Memory game | Исследовать портируемую игру Память
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

38 rindas
753B

  1. from CPP import *
  2. from Function import *
  3. def process(FILE_IN):
  4. # Read file.
  5. lines_in = []
  6. with open(FILE_IN) as file:
  7. for line in file:
  8. lines_in.append(line.rstrip())
  9. f = Function()
  10. out = includes()
  11. # Parse.
  12. for ln in lines_in:
  13. ln = ln.rstrip()
  14. # Empty line.
  15. if ln == "":
  16. out += "\n"
  17. # Comment.
  18. elif (
  19. ln.startswith("#") and
  20. not f.isBody
  21. ):
  22. out += replaceComment(ln) + "\n"
  23. # Function.
  24. else:
  25. f.parseLine(ln)
  26. if f.isComplete:
  27. cpp = CPP(f)
  28. out += cpp.translate()
  29. # Create new function instance.
  30. f = Function()
  31. return out