From 954069159a8ba70b22bef40c47f66e5f3e6b4303 Mon Sep 17 00:00:00 2001 From: lolabird Date: Mon, 19 Feb 2024 14:17:05 -0700 Subject: [PATCH] Rename files, add headers, fix typos in 13 --- .../{crossings.py => Problem11_crossings.py} | 4 ++++ .../{pascal.py => Problem13_pascal.py} | 8 ++++++-- .../Chapter-16-Exercises/{tree.py => Problem3_tree.py} | 4 ++++ .../{mountain.py => Problem4_mountain.py} | 4 ++++ .../{hanoi.py => Problem6and12_hanoi.py} | 4 ++++ .../{hilbert.py => Problem7_hilbert.py} | 3 +++ .../{kochsnowflake.py => Problem8_kochsnowflake.py} | 3 +++ .../{gallons.py => Problem9and10_gallons.py} | 3 +++ 8 files changed, 31 insertions(+), 2 deletions(-) rename thinkcspy/Chapter-16-Exercises/{crossings.py => Problem11_crossings.py} (95%) rename thinkcspy/Chapter-16-Exercises/{pascal.py => Problem13_pascal.py} (86%) rename thinkcspy/Chapter-16-Exercises/{tree.py => Problem3_tree.py} (92%) rename thinkcspy/Chapter-16-Exercises/{mountain.py => Problem4_mountain.py} (95%) rename thinkcspy/Chapter-16-Exercises/{hanoi.py => Problem6and12_hanoi.py} (96%) rename thinkcspy/Chapter-16-Exercises/{hilbert.py => Problem7_hilbert.py} (94%) rename thinkcspy/Chapter-16-Exercises/{kochsnowflake.py => Problem8_kochsnowflake.py} (94%) rename thinkcspy/Chapter-16-Exercises/{gallons.py => Problem9and10_gallons.py} (93%) diff --git a/thinkcspy/Chapter-16-Exercises/crossings.py b/thinkcspy/Chapter-16-Exercises/Problem11_crossings.py similarity index 95% rename from thinkcspy/Chapter-16-Exercises/crossings.py rename to thinkcspy/Chapter-16-Exercises/Problem11_crossings.py index 27cd385..a68eaf1 100644 --- a/thinkcspy/Chapter-16-Exercises/crossings.py +++ b/thinkcspy/Chapter-16-Exercises/Problem11_crossings.py @@ -1,3 +1,7 @@ +# Runestone.Academy thinkcspy course +# Chapter 16 +# Problem 11 + def cross(rounds, bank1, boat, bank2): if bank1["Missionaries"] + bank1["Cannibals"] == 0 and boat["Missionaries"] + boat["Cannibals"] == 0: return "Journey complete" diff --git a/thinkcspy/Chapter-16-Exercises/pascal.py b/thinkcspy/Chapter-16-Exercises/Problem13_pascal.py similarity index 86% rename from thinkcspy/Chapter-16-Exercises/pascal.py rename to thinkcspy/Chapter-16-Exercises/Problem13_pascal.py index 6068710..7969069 100644 --- a/thinkcspy/Chapter-16-Exercises/pascal.py +++ b/thinkcspy/Chapter-16-Exercises/Problem13_pascal.py @@ -1,4 +1,8 @@ -def createTriange(numRows): +# Runestone.Academy thinkcspy course +# Chapter 16 +# Problem 13 + +def createTriangle(numRows): if numRows < 0: return else: @@ -36,6 +40,6 @@ def factorial(number): -createTriange(10) +createTriangle(10) diff --git a/thinkcspy/Chapter-16-Exercises/tree.py b/thinkcspy/Chapter-16-Exercises/Problem3_tree.py similarity index 92% rename from thinkcspy/Chapter-16-Exercises/tree.py rename to thinkcspy/Chapter-16-Exercises/Problem3_tree.py index 1877005..bdf2223 100644 --- a/thinkcspy/Chapter-16-Exercises/tree.py +++ b/thinkcspy/Chapter-16-Exercises/Problem3_tree.py @@ -1,3 +1,7 @@ +# Runestone.Academy thinkcspy course +# Chapter 16 +# Problem 3 + import turtle import random diff --git a/thinkcspy/Chapter-16-Exercises/mountain.py b/thinkcspy/Chapter-16-Exercises/Problem4_mountain.py similarity index 95% rename from thinkcspy/Chapter-16-Exercises/mountain.py rename to thinkcspy/Chapter-16-Exercises/Problem4_mountain.py index 50eb438..4e47c89 100644 --- a/thinkcspy/Chapter-16-Exercises/mountain.py +++ b/thinkcspy/Chapter-16-Exercises/Problem4_mountain.py @@ -1,3 +1,7 @@ +# Runestone.Academy thinkcspy course +# Chapter 16 +# Problem 4 + import turtle import random diff --git a/thinkcspy/Chapter-16-Exercises/hanoi.py b/thinkcspy/Chapter-16-Exercises/Problem6and12_hanoi.py similarity index 96% rename from thinkcspy/Chapter-16-Exercises/hanoi.py rename to thinkcspy/Chapter-16-Exercises/Problem6and12_hanoi.py index 2c3d184..655f104 100644 --- a/thinkcspy/Chapter-16-Exercises/hanoi.py +++ b/thinkcspy/Chapter-16-Exercises/Problem6and12_hanoi.py @@ -1,3 +1,7 @@ +# Runestone.Academy thinkcspy course +# Chapter 16 +# Problems 6 and 12 + import turtle import random diff --git a/thinkcspy/Chapter-16-Exercises/hilbert.py b/thinkcspy/Chapter-16-Exercises/Problem7_hilbert.py similarity index 94% rename from thinkcspy/Chapter-16-Exercises/hilbert.py rename to thinkcspy/Chapter-16-Exercises/Problem7_hilbert.py index e9525cb..986f2c1 100644 --- a/thinkcspy/Chapter-16-Exercises/hilbert.py +++ b/thinkcspy/Chapter-16-Exercises/Problem7_hilbert.py @@ -1,3 +1,6 @@ +# Runestone.Academy thinkcspy course +# Chapter 16 +# Problem 7 import turtle diff --git a/thinkcspy/Chapter-16-Exercises/kochsnowflake.py b/thinkcspy/Chapter-16-Exercises/Problem8_kochsnowflake.py similarity index 94% rename from thinkcspy/Chapter-16-Exercises/kochsnowflake.py rename to thinkcspy/Chapter-16-Exercises/Problem8_kochsnowflake.py index 0194425..cb1f51b 100644 --- a/thinkcspy/Chapter-16-Exercises/kochsnowflake.py +++ b/thinkcspy/Chapter-16-Exercises/Problem8_kochsnowflake.py @@ -1,3 +1,6 @@ +# Runestone.Academy thinkcspy course +# Chapter 16 +# Problem 8 import turtle diff --git a/thinkcspy/Chapter-16-Exercises/gallons.py b/thinkcspy/Chapter-16-Exercises/Problem9and10_gallons.py similarity index 93% rename from thinkcspy/Chapter-16-Exercises/gallons.py rename to thinkcspy/Chapter-16-Exercises/Problem9and10_gallons.py index 1360f0d..08aec08 100644 --- a/thinkcspy/Chapter-16-Exercises/gallons.py +++ b/thinkcspy/Chapter-16-Exercises/Problem9and10_gallons.py @@ -1,3 +1,6 @@ +# Runestone.Academy thinkcspy course +# Chapter 16 +# Problems 9 and 10 def fillJug(rounds, jugA, jugB, target): pour = 0