summaryrefslogtreecommitdiff
path: root/Problem15.py
diff options
context:
space:
mode:
Diffstat (limited to 'Problem15.py')
-rw-r--r--Problem15.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/Problem15.py b/Problem15.py
new file mode 100644
index 0000000..5bc1d1e
--- /dev/null
+++ b/Problem15.py
@@ -0,0 +1,15 @@
+counter = 0
+size = 20
+def lattice(x,y):
+ global counter
+ if x > 0: #moves right
+ lattice(x-1,y)
+ counter+=1
+ if y > 0: #moves down
+ lattice(x,y-1)
+ counter+=1
+ print(counter)
+lattice(size,size)
+print(counter/(size+1))
+input("")
+