-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
43 lines (34 loc) · 1.1 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/usr/bin/python
import sys
from game import Game
from neural_network import Multilayerneuralnetwork
def main():
numplayers = None
numenemies = None
print 'Welcome to the game'
while numplayers not in [1, 2]:
try:
numplayers = int(raw_input('Please enter the number of players(1-2):'))
except ValueError:
print 'Invalid entry'
print 'Player one will be blue'
if numplayers == 2:
'Player two will be red'
while numenemies not in range(0, 9999999):
try:
numenemies = int(raw_input('Please enter the number of enemies:'))
except ValueError:
print 'Invalid entry'
print
print 'Training neural network...'
print
neuralnetwork = Multilayerneuralnetwork()
raw_input('Hit RETURN to start the game')
playagain = True
scorecard = {'Player': 0, 'yellow': 0, 'pink': 0, 'cyan': 0, 'green': 0, 'orange': 0}
while playagain:
print
game = Game(numplayers, numenemies, neuralnetwork, scorecard)
playagain = game.play()
if __name__ == '__main__':
main()