Task X04
This commit is contained in:
parent
ac50e8f1b7
commit
203cef8cca
2
TaskX04/run
Normal file
2
TaskX04/run
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
python TaskX04/run.py "$@"
|
19
TaskX04/run.py
Normal file
19
TaskX04/run.py
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
import sys
|
||||||
|
import re
|
||||||
|
|
||||||
|
commentPattern = re.compile('^#.*')
|
||||||
|
automataStepPattern = re.compile(r'[0-9]+ [0-9]+ [A-Za-z]+( ([0-9]+\.[0-9]+)|)')
|
||||||
|
|
||||||
|
#print("First argument: ", sys.argv[0])
|
||||||
|
|
||||||
|
steps = 0
|
||||||
|
|
||||||
|
for line in sys.stdin:
|
||||||
|
line = line.replace('\n', '')
|
||||||
|
if commentPattern.match(line):
|
||||||
|
continue
|
||||||
|
if automataStepPattern.match(line):
|
||||||
|
steps += 1
|
||||||
|
|
||||||
|
print(steps)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user