Research portable Memory game | Исследовать портируемую игру Память
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
521B

  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. # Parse.
  11. for ln in lines_in:
  12. ln = ln.rstrip()
  13. f.parseLine(ln)
  14. if f.isComplete:
  15. print("Function ready! Here it is in C++:")
  16. cpp = CPP(f)
  17. print(cpp.translate())
  18. # Create new function instance.
  19. f = Function()