From 1161f9a034de06a63538e3a9a0b7717098c744d9 Mon Sep 17 00:00:00 2001 From: Joshua Drake Date: Fri, 7 Apr 2023 08:13:49 -0500 Subject: Initial Commit --- Problem15.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 Problem15.py (limited to 'Problem15.py') 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("") + -- cgit v1.2.3