Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add files via upload #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 70 additions & 0 deletions plan_matches.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
import sys


import argparse
parser = argparse.ArgumentParser()
parser.add_argument("filename", help="name of input file")
args = parser.parse_args()
f= sys.argv[1]
agones=[]
with open(f) as graph1:
for line in graph1:
temp=[]
i=0
for x in line.split():
if i==1:
temp.append(x)
if i<1:
i=i+1
temp.append(x)
agones.append(temp)
day=0
agones_teliko=[]

while len(agones)>0:
k=0
daylist=[]
for i in range(len(agones)):
if k>0:
flag=False
for l in daylist:
if agones[i][0] in l or agones[i][1] in l:
flag=True



if flag==False:
temp=[]
temp.append(agones[i])
temp.append(day)
daylist.append(agones[i])
agones_teliko.append(temp)


if k==0:
temp=[]
temp.append(agones[i])
temp.append(day)
daylist.append(agones[i])
agones_teliko.append(temp)
k= k +1

day= day+1

for i in daylist:

agones.remove(i)
daylist=[]
agones_teliko.sort(key=lambda x: x[0])

for i in range(len(agones_teliko)):
print("(",agones_teliko[i][0][0],", ",agones_teliko[i][0][1],") ",agones_teliko[i][1])