From 3dcfa5d315373c74e771206e60f277a7111c359b Mon Sep 17 00:00:00 2001 From: kathrynoh23 <126970932+kathrynoh23@users.noreply.github.com> Date: Tue, 15 Aug 2023 15:02:10 -0400 Subject: [PATCH] Kathryn Odell-Hamilton MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Started out with repetitive code to draw shapes, then used "ranges" to simplfy code drawing shapes and print numbers (even, odd, multiples), and experimenting with a complicated set of ranges drawing tiles with patterns. Checkpoint 1 - Yes, at first it was difficult drawing squares using a for-loop. I understood the definition of "square" with a for-loop in range of 4, the 4 sides using once each, forward and right. I didn't realize that the sizes = [20, 20, 20, 20] needed to be included within the code where it tells "for size in sizes" the square size and move forward to draw the next square. I reviewed the Iteration documentation several times and online, docs.python.org/3/library/turtle.html. Also, I asked you for assistance and then it made sense. Checkpoint 2 - I liked using “ranges” to generate a sequence of numbers and simplifying repetitive code. - Defining the sizes for a def and range. Such as "def square(side_length)". I see it's reference in "forward(side_length)", but (side_length) it seems arbitrary and abstract. Is it how to best describe what the "def" is. Are we talking about the name and value? And then defined within a "for-loop" incorporating a "range"? Checkpoint 3 - Yes, I will write docstrings when writing programs. The docstrings good for writing multiple lines of information explaining the code function by using """ at the beginning and end of the lines instead of " for each line. -Docstrings were useful with typing the explanation in tile_grid.py and experimented information in tile.py files. --- .DS_Store | Bin 0 -> 6148 bytes __pycache__/tile.cpython-311.pyc | Bin 0 -> 2800 bytes __pycache__/tile_grid.cpython-311.pyc | Bin 0 -> 1866 bytes __pycache__/tile_new_pattern.cpython-311.pyc | Bin 0 -> 2560 bytes draw_shapes_inside_shapes.py | 25 +++++ drawtiles.py | 5 +- experimenting_circles.py | 12 +++ poetry.lock | 91 +++++++++++-------- ranges.py | 9 +- square.py | 20 ++-- square_lists_drawing_squares.py | 18 ++++ square_multiple pen up n down.py | 20 ++++ square_sidebyside.py | 17 ++++ square_test_with_space_inbetween.py | 17 ++++ square_with_space_inbetween.py | 36 ++++++++ tile.py | 14 ++- tile_grid.py | 11 ++- tile_new_pattern.py | 45 +++++++++ 18 files changed, 284 insertions(+), 56 deletions(-) create mode 100644 .DS_Store create mode 100644 __pycache__/tile.cpython-311.pyc create mode 100644 __pycache__/tile_grid.cpython-311.pyc create mode 100644 __pycache__/tile_new_pattern.cpython-311.pyc create mode 100644 draw_shapes_inside_shapes.py create mode 100644 experimenting_circles.py create mode 100644 square_lists_drawing_squares.py create mode 100644 square_multiple pen up n down.py create mode 100644 square_sidebyside.py create mode 100644 square_test_with_space_inbetween.py create mode 100644 square_with_space_inbetween.py create mode 100644 tile_new_pattern.py diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..5008ddfcf53c02e82d7eee2e57c38e5672ef89f6 GIT binary patch literal 6148 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 EA4Kt^hX4Qo literal 0 HcmV?d00001 diff --git a/__pycache__/tile_new_pattern.cpython-311.pyc b/__pycache__/tile_new_pattern.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8dd7481c547b390a5aab1e99be42ce672e7e573a GIT binary patch literal 2560 zcmb_d&1)M+6rYtw(%P0%JGJak+jP>JwhAGtOKDRmJp>cmIJIf(wluUTYt2Ynyxvu3 zR}~g6NT9dqDyn%7RXz2j2v~<<$39A4pcJIMC7VPqXv!=Dpv% zkKbakNdoOp<1hYukdSBi(QAQj=i)AO9urQuVvrre16A@+;X%Lvr+`5o0;D_)7~&DY zFjoO1eBvvTm^?=@3B^-xrIoHk{Daf{_u?LO9usF^?vR|q*I9o=Ar7wYw$WLxz&U}^ z-Bqa-ZDyH*Il3Wkvtmw9=U7@Z*{)zxm^~MTI~5w@@rd2JGrMhIeB0vSB1UjSo!3>wx^rf zR8e!f=j$D;uuDl|}1S#GsMc(Fq1IE<6Fw>S{NiPf> zX;R1ts_WAuC!i}sJy3DtO@K0K(Wv`fU-K57bU&;-s6HtBKRE?!hD@L^fGk}60&*{V z30F$6VVog6FfxlubsG3W$auOMNBjj?+(0H7O9xvRCAqx+TZ>UMb>z3STrjW=n$PU9`Ay4Ne~)%Egv3&ZBg%1Nd{ zmzs2`PM2DAwzl)+=E*k=y4a+Pb-MVXkn4HmjTE&7s3!rm|7pC~pjm zmO+hC$40029s7Ie3_JEIjGV#SX)jBD&cG#I-q}rzbDvv337cU~g51V1$3TvPv={V3 z5X6PNd>zj6BGBhn(S%&Ba@}?`Gu_R0op7FqMH1l+ci|AIQZuu{r$^4hSRx=XmtiH~!o~v0ScjZz(3c1dUi%XOAZI#W z(@xZ1)iw!)W_)mIOMR_Ik7CC$H`Y?4?w3dEvFgIF9qO$a!`FKtcbKn3G6i|+6jV9u z)oY?ajRuQ@rT2RlcLNPghH3~Ac$+x|X@VDEIdpPR9x)>CbPR`57f$Ok?H9eU)VN-- z2lILyw2%ns12%dCI>MxT-~G6DubZV{O=~^NgoFU%=7}S3b z2N7=J#0`Ls{vXvoXwbPPovZgAU;C|u>V<(W#}Iy1?$os~3h_h2zj~h&l=+nSn|!Z$ zu70|2@q!^flkdV5mPWe@&<-k!@;8~S_ntNlDmU7s50e1}{iO$LREf1o9~P-{txft6 WrMRvS(Ey6-gBnog@$)kHTK)?gwES)W literal 0 HcmV?d00001 diff --git a/draw_shapes_inside_shapes.py b/draw_shapes_inside_shapes.py new file mode 100644 index 0000000..0aab7fa --- /dev/null +++ b/draw_shapes_inside_shapes.py @@ -0,0 +1,25 @@ +# shapes.py +# --------- +# By MWC contributors + +from turtle import * + + +pendown() + + +def rectangle(height_width): + forward(height_width) + right(90) + forward(height_width) + right(90) + forward(height_width) + right(90) + forward(height_width) + right(90) + +rectangle(100) +rectangle(80) +rectangle(60) +rectangle(40) +rectangle(20) \ No newline at end of file diff --git a/drawtiles.py b/drawtiles.py index d855f01..9f6528d 100644 --- a/drawtiles.py +++ b/drawtiles.py @@ -1,4 +1,5 @@ -# drawtiles.py + +list# drawtiles.py # ------------ # By MWC Contributors # @@ -14,6 +15,7 @@ parser = ArgumentParser("python drawtiles.py", description="Draws a grid of tile parser.add_argument("width", type=int, help="How many tiles across the grid should be") parser.add_argument("height", type=int, help="How many tiles high the grid should be") parser.add_argument("size", type=int, help="Side length of each tile") +"I tried at add Color Choice (4 colors) here and within tile_grid.py, but it didn't work" parser.add_argument("--fast", action="store_true", help="Skip turtle animation and show the result") args = parser.parse_args() @@ -23,4 +25,3 @@ if args.fast: else: draw_tile_grid(args.width, args.height, args.size, draw_tile) input() - diff --git a/experimenting_circles.py b/experimenting_circles.py new file mode 100644 index 0000000..26db131 --- /dev/null +++ b/experimenting_circles.py @@ -0,0 +1,12 @@ +from turtle import * + +#Circle +circle(20) +position() +(-0.00,0.00) + +#Semi-circle +circle(40, 180) +(0.00,240.00) + +done() \ No newline at end of file diff --git a/poetry.lock b/poetry.lock index daa6053..5bbd5ca 100644 --- a/poetry.lock +++ b/poetry.lock @@ -42,13 +42,13 @@ lxml = ["lxml"] [[package]] name = "certifi" -version = "2023.5.7" +version = "2023.7.22" description = "Python package for providing Mozilla's CA Bundle." optional = false python-versions = ">=3.6" files = [ - {file = "certifi-2023.5.7-py3-none-any.whl", hash = "sha256:c6c2e98f5c7869efca1f8916fed228dd91539f9f1b444c314c06eef02980c716"}, - {file = "certifi-2023.5.7.tar.gz", hash = "sha256:0f0d56dc5a6ad56fd4ba36484d6cc34451e1c6548c61daad8c320169f91eddc7"}, + {file = "certifi-2023.7.22-py3-none-any.whl", hash = "sha256:92d6037539857d8206b8f6ae472e8b77db8058fec5937a1ef3f54304089edbb9"}, + {file = "certifi-2023.7.22.tar.gz", hash = "sha256:539cc1d13202e33ca466e88b2807e29f4c13049d6d87031a3c110744495cb082"}, ] [[package]] @@ -159,13 +159,13 @@ files = [ [[package]] name = "furo" -version = "2023.5.20" +version = "2023.7.26" description = "A clean customisable Sphinx documentation theme." optional = false python-versions = ">=3.7" files = [ - {file = "furo-2023.5.20-py3-none-any.whl", hash = "sha256:594a8436ddfe0c071f3a9e9a209c314a219d8341f3f1af33fdf7c69544fab9e6"}, - {file = "furo-2023.5.20.tar.gz", hash = "sha256:40e09fa17c6f4b22419d122e933089226dcdb59747b5b6c79363089827dea16f"}, + {file = "furo-2023.7.26-py3-none-any.whl", hash = "sha256:1c7936929ec57c5ddecc7c85f07fa8b2ce536b5c89137764cca508be90e11efd"}, + {file = "furo-2023.7.26.tar.gz", hash = "sha256:257f63bab97aa85213a1fa24303837a3c3f30be92901ec732fea74290800f59e"}, ] [package.dependencies] @@ -285,13 +285,13 @@ files = [ [[package]] name = "pygments" -version = "2.15.1" +version = "2.16.1" description = "Pygments is a syntax highlighting package written in Python." optional = false python-versions = ">=3.7" files = [ - {file = "Pygments-2.15.1-py3-none-any.whl", hash = "sha256:db2db3deb4b4179f399a09054b023b6a586b76499d36965813c71aa8ed7b5fd1"}, - {file = "Pygments-2.15.1.tar.gz", hash = "sha256:8ace4d3c1dd481894b2005f560ead0f9f19ee64fe983366be1a21e171d12775c"}, + {file = "Pygments-2.16.1-py3-none-any.whl", hash = "sha256:13fc09fa63bc8d8671a6d247e1eb303c4b343eaee81d861f3404db2935653692"}, + {file = "Pygments-2.16.1.tar.gz", hash = "sha256:1daff0494820c69bc8941e407aa20f577374ee88364ee10a98fdbe0aece96e29"}, ] [package.extras] @@ -342,13 +342,13 @@ files = [ [[package]] name = "sphinx" -version = "7.0.1" +version = "7.1.2" description = "Python documentation generator" optional = false python-versions = ">=3.8" files = [ - {file = "Sphinx-7.0.1.tar.gz", hash = "sha256:61e025f788c5977d9412587e733733a289e2b9fdc2fef8868ddfbfc4ccfe881d"}, - {file = "sphinx-7.0.1-py3-none-any.whl", hash = "sha256:60c5e04756c1709a98845ed27a2eed7a556af3993afb66e77fec48189f742616"}, + {file = "sphinx-7.1.2-py3-none-any.whl", hash = "sha256:d170a81825b2fcacb6dfd5a0d7f578a053e45d3f2b153fecc948c37344eb4cbe"}, + {file = "sphinx-7.1.2.tar.gz", hash = "sha256:780f4d32f1d7d1126576e0e5ecc19dc32ab76cd24e950228dcf7b1f6d3d9e22f"}, ] [package.dependencies] @@ -393,45 +393,54 @@ docs = ["furo", "ipython", "myst-parser", "sphinx-copybutton", "sphinx-inline-ta [[package]] name = "sphinxcontrib-applehelp" -version = "1.0.4" +version = "1.0.7" description = "sphinxcontrib-applehelp is a Sphinx extension which outputs Apple help books" optional = false -python-versions = ">=3.8" +python-versions = ">=3.9" files = [ - {file = "sphinxcontrib-applehelp-1.0.4.tar.gz", hash = "sha256:828f867945bbe39817c210a1abfd1bc4895c8b73fcaade56d45357a348a07d7e"}, - {file = "sphinxcontrib_applehelp-1.0.4-py3-none-any.whl", hash = "sha256:29d341f67fb0f6f586b23ad80e072c8e6ad0b48417db2bde114a4c9746feb228"}, + {file = "sphinxcontrib_applehelp-1.0.7-py3-none-any.whl", hash = "sha256:094c4d56209d1734e7d252f6e0b3ccc090bd52ee56807a5d9315b19c122ab15d"}, + {file = "sphinxcontrib_applehelp-1.0.7.tar.gz", hash = "sha256:39fdc8d762d33b01a7d8f026a3b7d71563ea3b72787d5f00ad8465bd9d6dfbfa"}, ] +[package.dependencies] +Sphinx = ">=5" + [package.extras] lint = ["docutils-stubs", "flake8", "mypy"] test = ["pytest"] [[package]] name = "sphinxcontrib-devhelp" -version = "1.0.2" -description = "sphinxcontrib-devhelp is a sphinx extension which outputs Devhelp document." +version = "1.0.5" +description = "sphinxcontrib-devhelp is a sphinx extension which outputs Devhelp documents" optional = false -python-versions = ">=3.5" +python-versions = ">=3.9" files = [ - {file = "sphinxcontrib-devhelp-1.0.2.tar.gz", hash = "sha256:ff7f1afa7b9642e7060379360a67e9c41e8f3121f2ce9164266f61b9f4b338e4"}, - {file = "sphinxcontrib_devhelp-1.0.2-py2.py3-none-any.whl", hash = "sha256:8165223f9a335cc1af7ffe1ed31d2871f325254c0423bc0c4c7cd1c1e4734a2e"}, + {file = "sphinxcontrib_devhelp-1.0.5-py3-none-any.whl", hash = "sha256:fe8009aed765188f08fcaadbb3ea0d90ce8ae2d76710b7e29ea7d047177dae2f"}, + {file = "sphinxcontrib_devhelp-1.0.5.tar.gz", hash = "sha256:63b41e0d38207ca40ebbeabcf4d8e51f76c03e78cd61abe118cf4435c73d4212"}, ] +[package.dependencies] +Sphinx = ">=5" + [package.extras] lint = ["docutils-stubs", "flake8", "mypy"] test = ["pytest"] [[package]] name = "sphinxcontrib-htmlhelp" -version = "2.0.1" +version = "2.0.4" description = "sphinxcontrib-htmlhelp is a sphinx extension which renders HTML help files" optional = false -python-versions = ">=3.8" +python-versions = ">=3.9" files = [ - {file = "sphinxcontrib-htmlhelp-2.0.1.tar.gz", hash = "sha256:0cbdd302815330058422b98a113195c9249825d681e18f11e8b1f78a2f11efff"}, - {file = "sphinxcontrib_htmlhelp-2.0.1-py3-none-any.whl", hash = "sha256:c38cb46dccf316c79de6e5515e1770414b797162b23cd3d06e67020e1d2a6903"}, + {file = "sphinxcontrib_htmlhelp-2.0.4-py3-none-any.whl", hash = "sha256:8001661c077a73c29beaf4a79968d0726103c5605e27db92b9ebed8bab1359e9"}, + {file = "sphinxcontrib_htmlhelp-2.0.4.tar.gz", hash = "sha256:6c26a118a05b76000738429b724a0568dbde5b72391a688577da08f11891092a"}, ] +[package.dependencies] +Sphinx = ">=5" + [package.extras] lint = ["docutils-stubs", "flake8", "mypy"] test = ["html5lib", "pytest"] @@ -452,30 +461,36 @@ test = ["flake8", "mypy", "pytest"] [[package]] name = "sphinxcontrib-qthelp" -version = "1.0.3" -description = "sphinxcontrib-qthelp is a sphinx extension which outputs QtHelp document." +version = "1.0.6" +description = "sphinxcontrib-qthelp is a sphinx extension which outputs QtHelp documents" optional = false -python-versions = ">=3.5" +python-versions = ">=3.9" files = [ - {file = "sphinxcontrib-qthelp-1.0.3.tar.gz", hash = "sha256:4c33767ee058b70dba89a6fc5c1892c0d57a54be67ddd3e7875a18d14cba5a72"}, - {file = "sphinxcontrib_qthelp-1.0.3-py2.py3-none-any.whl", hash = "sha256:bd9fc24bcb748a8d51fd4ecaade681350aa63009a347a8c14e637895444dfab6"}, + {file = "sphinxcontrib_qthelp-1.0.6-py3-none-any.whl", hash = "sha256:bf76886ee7470b934e363da7a954ea2825650013d367728588732c7350f49ea4"}, + {file = "sphinxcontrib_qthelp-1.0.6.tar.gz", hash = "sha256:62b9d1a186ab7f5ee3356d906f648cacb7a6bdb94d201ee7adf26db55092982d"}, ] +[package.dependencies] +Sphinx = ">=5" + [package.extras] lint = ["docutils-stubs", "flake8", "mypy"] test = ["pytest"] [[package]] name = "sphinxcontrib-serializinghtml" -version = "1.1.5" -description = "sphinxcontrib-serializinghtml is a sphinx extension which outputs \"serialized\" HTML files (json and pickle)." +version = "1.1.8" +description = "sphinxcontrib-serializinghtml is a sphinx extension which outputs \"serialized\" HTML files (json and pickle)" optional = false -python-versions = ">=3.5" +python-versions = ">=3.9" files = [ - {file = "sphinxcontrib-serializinghtml-1.1.5.tar.gz", hash = "sha256:aa5f6de5dfdf809ef505c4895e51ef5c9eac17d0f287933eb49ec495280b6952"}, - {file = "sphinxcontrib_serializinghtml-1.1.5-py2.py3-none-any.whl", hash = "sha256:352a9a00ae864471d3a7ead8d7d79f5fc0b57e8b3f95e9867eb9eb28999b92fd"}, + {file = "sphinxcontrib_serializinghtml-1.1.8-py3-none-any.whl", hash = "sha256:27849e7227277333d3d32f17c138ee148a51fa01f888a41cd6d4e73bcabe2d06"}, + {file = "sphinxcontrib_serializinghtml-1.1.8.tar.gz", hash = "sha256:aaf3026335146e688fd209b72320314b1b278320cf232e3cda198f873838511a"}, ] +[package.dependencies] +Sphinx = ">=5" + [package.extras] lint = ["docutils-stubs", "flake8", "mypy"] test = ["pytest"] @@ -497,13 +512,13 @@ sphinx = ">=7.0.1,<8.0.0" [[package]] name = "urllib3" -version = "2.0.3" +version = "2.0.4" description = "HTTP library with thread-safe connection pooling, file post, and more." optional = false python-versions = ">=3.7" files = [ - {file = "urllib3-2.0.3-py3-none-any.whl", hash = "sha256:48e7fafa40319d358848e1bc6809b208340fafe2096f1725d05d67443d0483d1"}, - {file = "urllib3-2.0.3.tar.gz", hash = "sha256:bee28b5e56addb8226c96f7f13ac28cb4c301dd5ea8a6ca179c0b9835e032825"}, + {file = "urllib3-2.0.4-py3-none-any.whl", hash = "sha256:de7df1803967d2c2a98e4b11bb7d6bd9210474c46e8a0401514e3a42a75ebde4"}, + {file = "urllib3-2.0.4.tar.gz", hash = "sha256:8d22f86aae8ef5e410d4f539fde9ce6b2113a001bb4d189e0aed70642d602b11"}, ] [package.extras] diff --git a/ranges.py b/ranges.py index 2fa00d7..02e992f 100644 --- a/ranges.py +++ b/ranges.py @@ -9,15 +9,18 @@ def print_all_numbers(maximum): def print_even_numbers(maximum): "Prints all even integers from 0 to maximum." - pass + for number in range(0, maximum, 2): + print(number) def print_odd_numbers(maximum): "Prints all odd integers from 0 to maximum." - pass + for number in range(0 + 1, maximum + 1, 2): + print(number) def print_multiples_of_five(maximum): "Prints all integers which are multiples of five from 0 to maximum." - pass + for number in range(0, maximum, 5): + print(number) chosen_maximum = int(input("Choose a number: ")) print(f"All numbers from 0 to {chosen_maximum}") diff --git a/square.py b/square.py index c5f1cac..aac8ec5 100644 --- a/square.py +++ b/square.py @@ -1,16 +1,16 @@ from turtle import * def square(side_length): - forward(side_length) - right(90) - forward(side_length) - right(90) - forward(side_length) - right(90) - forward(side_length) - right(90) + for side in range(4): + forward(side_length) + right(90) + +sizes = [20, 20, 20, 20] -sizes = [20, 40, 60, 80, 100] for size in sizes: - square(size) + + square(size) + penup() + forward(size+20) + pendown() diff --git a/square_lists_drawing_squares.py b/square_lists_drawing_squares.py new file mode 100644 index 0000000..90c981f --- /dev/null +++ b/square_lists_drawing_squares.py @@ -0,0 +1,18 @@ +from turtle import * + +def square(side_length): + forward(side_length) + right(90) + forward(side_length) + right(90) + forward(side_length) + right(90) + forward(side_length) + right(90) + +sizes = [20, 40, 60, 80, 100] +for size in sizes: + square(size) + +#Drawing 4 squares inside a square + \ No newline at end of file diff --git a/square_multiple pen up n down.py b/square_multiple pen up n down.py new file mode 100644 index 0000000..7c3c85b --- /dev/null +++ b/square_multiple pen up n down.py @@ -0,0 +1,20 @@ +from turtle import * + +def square(): + for square in range(4): + forward(20) + right(90) + +square() +penup() +forward(40) +pendown() +square() +penup() +forward(40) +pendown() +square() +penup() +forward(40) +pendown() +square() diff --git a/square_sidebyside.py b/square_sidebyside.py new file mode 100644 index 0000000..65166bb --- /dev/null +++ b/square_sidebyside.py @@ -0,0 +1,17 @@ +from turtle import * + +def square(): + forward(100) + right(90) + forward(100) + right(90) + forward(100) + right(90) + forward(100) + right(90) + +square() +forward(100) +square() +forward(100) +square() diff --git a/square_test_with_space_inbetween.py b/square_test_with_space_inbetween.py new file mode 100644 index 0000000..0b42327 --- /dev/null +++ b/square_test_with_space_inbetween.py @@ -0,0 +1,17 @@ +from turtle import * + +def square(side_length): + for side in range(4): + forward(side_length) + right(90) + +sizes = [20, 60, 90, 120] + +for size in sizes: + + square(size) + penup() + forward(size+20) + pendown() + +done() diff --git a/square_with_space_inbetween.py b/square_with_space_inbetween.py new file mode 100644 index 0000000..395d2bc --- /dev/null +++ b/square_with_space_inbetween.py @@ -0,0 +1,36 @@ +from turtle import * + +def square(side_length): + forward(side_length) + right(90) + forward(side_length) + right(90) + forward(side_length) + right(90) + forward(side_length) + right(90) + +sizes = [20] + +for size in sizes: + + square(20) + penup() + forward(40) + pendown() + + square(20) + penup() + forward(40) + pendown() + + square(20) + penup() + forward(40) + pendown() + + square(20) + penup() + forward(40) + pendown() +done() diff --git a/tile.py b/tile.py index 697cf8e..4fc560f 100644 --- a/tile.py +++ b/tile.py @@ -4,17 +4,25 @@ def draw_tile(size): "Draws one tile, which can be repeated to form a pattern." draw_tile_outline(size) draw_squiggle(size) + """Here. If you change outline the boxes are small, not connencted and squiggles drawing outside. + Here. If you change squiggles, they draw extremley small in bottom left corner of boxes, correct size.""" def draw_tile_outline(size): - pencolor("#dddddd") + "Changed Pen color from black to blue" + pencolor("blue") + pensize(2) square(size) def draw_squiggle(size): + pensize(3) forward(size/4) - pencolor("black") + pencolor("purple") left(90) quarter_arc_right(size/4) quarter_arc_left(size/4) + pensize(1) + pencolor("red") + quarter_arc_left(size/4) quarter_arc_right(size/4) left(90) @@ -42,3 +50,5 @@ def quarter_arc_right(radius): def quarter_arc_left(radius): "Draws a quarter of an arc, turning to the left." circle(radius, 90) + + diff --git a/tile_grid.py b/tile_grid.py index 72a0f43..67af96c 100644 --- a/tile_grid.py +++ b/tile_grid.py @@ -10,7 +10,16 @@ from tile import fly def draw_tile_grid(width, height, tile_size, tile_function): """Draws a (width x height) grid, with tile_function drawn on each tile. - (Your explanation here.) + (The draw_tile_grid function is importing from the tile.py defined functions "draw_tile_outline" and + draw_squiggle to repeat the individual elements, tiles. + Within draw_tile_grid, you use a "range" to repeat the height and width for size and moving (fly) without + drawing. Then using the definition of "return_to_x_origin" and "return_to_y_origin" to the next x and y + coordinates to position the pen to draw the next tile or begin the next row. + Just as important is "drawtiles.py" file that calls the arguments/parameters for user input of width, + height, and size. Although, the if else statement is using the defintion "draw_tile" where the argument prompt + is coming from the "tile.py" definition "draw_tile. + The 3 python files, drawtiles.py, tile.py, and tile_grid.py are drawing functions from each file without + having to repeat the code in each file. Complicated and intricate. It's functional.) """ for y in range(height): for x in range(width): diff --git a/tile_new_pattern.py b/tile_new_pattern.py new file mode 100644 index 0000000..8129edc --- /dev/null +++ b/tile_new_pattern.py @@ -0,0 +1,45 @@ +from turtle import * + +def draw_tile(size): + "Draws one tile, which can be repeated to form a pattern." + draw_tile_outline(size) + draw_squiggle(size) + +def draw_tile_outline(size): + pencolor("#dddddd") + square(size) + +def draw_squiggle(size): + forward(size/2) + pencolor("black") + left(90) + pendown() + quarter_arc_right(size/2) + quarter_arc_left(size/2) + quarter_arc_left(size/2) + quarter_arc_right(size/2) + left(90) + fly(size/2) + left(90) + fly(size) + left(90) + +def fly(distance): + "Moves without drawing." + penup() + forward(distance) + pendown() + +def square(size): + "Draws a square of side length `size`" + for side in range(4): + forward(size) + left(90) + +def quarter_arc_right(radius): + "Draws a quarter of an arc, turning to the right." + circle(-radius, 90) + +def quarter_arc_left(radius): + "Draws a quarter of an arc, turning to the left." + circle(radius, 90)