Skip to content

Instantly share code, notes, and snippets.

@rdeguzman
Created April 26, 2013 08:52
Show Gist options
  • Save rdeguzman/5465843 to your computer and use it in GitHub Desktop.
Save rdeguzman/5465843 to your computer and use it in GitHub Desktop.
109 def getGames(n, t):
110 teams = n
111 table = t[:]
112 if n % 2 == 0:
113 games = [[] for i in range(0, (2*(n-1)))]
114 elif n % 2 != 0:
115 games = [[] for i in range(0, (2*n))]
116 for y in range(0, n):
117 a = table[y]
118 for x in range(0, n):
119 z = (y, x)
120 print z
121 games[a[x]].append(z)
122
123 print games
124
125 return games
~/Desktop/CITS1401% python project1test.py
(' initialTable:', 'all 2 test(s) correct')
(' doubleLastColumn:', 'all 2 test(s) correct')
(' wrapEntries:', 'all 2 test(s) correct')
(' extendTable:', 'all 2 test(s) correct')
(' reflectTable:', 'all 2 test(s) correct')
(' buildEvenTable:', 'all 2 test(s) correct')
(' stripDummy:', 'all 1 test(s) correct')
(' buildTable:', 'all 2 test(s) correct')
(0, 0)
(0, 1)
(0, 2)
(0, 3)
(1, 0)
(1, 1)
(1, 2)
(1, 3)
(2, 0)
(2, 1)
(2, 2)
(2, 3)
(3, 0)
(3, 1)
(3, 2)
(3, 3)
[[(3, 3)], [(2, 3)], [(1, 3)], [(0, 3)], [], []]
(' getGames:', 'These tests incorrect: 0')
(' parsefile:', 'all 1 test(s) correct')
(' printGames:', 'untested')
(' main:', 'untested')
~/Desktop/CITS1401%
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment