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.
|
- from CPP import *
- from Function import *
-
- def process(FILE_IN):
- # Read file.
- lines_in = []
- with open(FILE_IN) as file:
- for line in file:
- lines_in.append(line.rstrip())
-
- f = Function()
- out = includes()
-
- # Parse.
- for ln in lines_in:
- ln = ln.rstrip()
-
- # Empty line.
- if ln == "":
- out += "\n"
- # Comment.
- elif (
- ln.startswith("#") and
- not f.isBody
- ):
- out += replaceComment(ln) + "\n"
- # Function.
- else:
- f.parseLine(ln)
-
- if f.isComplete:
- cpp = CPP(f)
- out += cpp.translate()
- # Create new function instance.
- f = Function()
-
- return out
|