diff options
author | Joshua Drake <joshua.drake@ditchwitch.com> | 2023-04-07 08:13:49 -0500 |
---|---|---|
committer | Joshua Drake <joshua.drake@ditchwitch.com> | 2023-04-07 08:13:49 -0500 |
commit | 1161f9a034de06a63538e3a9a0b7717098c744d9 (patch) | |
tree | 55bb842b2daa4f096eb7916a8d3630426fc1c376 /Problem15.py |
Diffstat (limited to 'Problem15.py')
-rw-r--r-- | Problem15.py | 15 |
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("") + |