aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Tom van der Lee <t0m.vd.l33@gmail.com>2014-04-08 16:19:24 +0200
committerGravatar Tom van der Lee <t0m.vd.l33@gmail.com>2014-04-08 16:19:24 +0200
commit732bef2e44bc8974d2c9ed4543b6fb2105e453e2 (patch)
treeea580258612ab0e3e9c28d47cf461123fd039752
parenta1ce8d174db3cdfc636f80409fb7114c2d24e868 (diff)
downloadminesweeper-py-732bef2e44bc8974d2c9ed4543b6fb2105e453e2.tar.gz
minesweeper-py-732bef2e44bc8974d2c9ed4543b6fb2105e453e2.tar.bz2
minesweeper-py-732bef2e44bc8974d2c9ed4543b6fb2105e453e2.zip
Added gitignore and added improvements
-rw-r--r--.gitignore2
-rw-r--r--field.py10
2 files changed, 10 insertions, 2 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..7a60b85
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,2 @@
1__pycache__/
2*.pyc
diff --git a/field.py b/field.py
index 5372c09..f7a2544 100644
--- a/field.py
+++ b/field.py
@@ -63,17 +63,23 @@ class Field:
63 63
64 def printField(self): 64 def printField(self):
65 i = 1 65 i = 1
66
66 print("\n\t", end="") 67 print("\n\t", end="")
67 for char in range(0,self.width): 68 for char in range(0,self.width):
68 print(chr(char+65) + " ", end="") 69 print(chr(char+65) + " ", end="")
69 print("\n") 70 print("\n")
71
70 for list in self.field: 72 for list in self.field:
71 print(str(i) + "\t", end = '') 73 print(str(i) + "\t", end = '')
72 for item in list: 74 for item in list:
73 print(item.printCell() + " ", end='') 75 print(item.printCell() + " ", end='')
74 print() 76 print("\t" + str(i))
75 i += 1 77 i += 1
76 return 78
79 print("\n\t", end="")
80 for char in range(0,self.width):
81 print(chr(char+65) + " ", end="")
82 print("\n")
77 83
78 def cleared(self): 84 def cleared(self):
79 safe = 0 85 safe = 0