From 9dc4245e6e553d83c3d478da8da64ffd5f731e1b Mon Sep 17 00:00:00 2001 From: landongrindheim Date: Wed, 25 Sep 2013 22:00:38 -0400 Subject: [PATCH 01/89] Create 2013-09-25-landons-frustrating-codingbat-exercise.md --- ...013-09-25-landons-frustrating-codingbat-exercise.md | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 _posts/2013-09-25-landons-frustrating-codingbat-exercise.md diff --git a/_posts/2013-09-25-landons-frustrating-codingbat-exercise.md b/_posts/2013-09-25-landons-frustrating-codingbat-exercise.md new file mode 100644 index 0000000..328a8b7 --- /dev/null +++ b/_posts/2013-09-25-landons-frustrating-codingbat-exercise.md @@ -0,0 +1,10 @@ +--- +layout: posts +author: lgrindheim +categories: posts +published: True +--- + +Just pretend that white star is taking a long time to twinkle. + +![ugh](http://landonandjana.files.wordpress.com/2013/09/screen-shot-2013-09-25-at-9-53-01-pm.png) From dc02316d15dae569d2bda4c726f0608a4adf2550 Mon Sep 17 00:00:00 2001 From: alexharding Date: Mon, 30 Sep 2013 09:25:12 -0400 Subject: [PATCH 02/89] creating post for my addnames.py example code --- .../alexharding/2013-09-30-alex-addnames.md | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 _posts/alexharding/2013-09-30-alex-addnames.md diff --git a/_posts/alexharding/2013-09-30-alex-addnames.md b/_posts/alexharding/2013-09-30-alex-addnames.md new file mode 100644 index 0000000..fe979e9 --- /dev/null +++ b/_posts/alexharding/2013-09-30-alex-addnames.md @@ -0,0 +1,29 @@ +--- +type: post +author: alexharding +published: true +--- + + + + + + +#My Code + +What follows is my python code which allows the user to add their own list of names and choose a file name to write out to. + +``` Python + +def add_names(list_of_names, file): + names_file = open(file, 'a') + for name in list_of_names: + print >> names_file, name + names_file.close() + + +new_names = input('Type a list of names. ') +file_name = input('Type a file name ')+'.txt' +add_names(new_names,file_name) +print 'This program created '+str(file_name)+' in your home directory.' +``` From 661d47d2e740a35516ac56268b80e0e222fe9917 Mon Sep 17 00:00:00 2001 From: alexharding Date: Mon, 30 Sep 2013 09:27:33 -0400 Subject: [PATCH 03/89] fixing jekyl problem --- _posts/alexharding/2013-09-30-alex-addnames.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/_posts/alexharding/2013-09-30-alex-addnames.md b/_posts/alexharding/2013-09-30-alex-addnames.md index fe979e9..29faf63 100644 --- a/_posts/alexharding/2013-09-30-alex-addnames.md +++ b/_posts/alexharding/2013-09-30-alex-addnames.md @@ -1,5 +1,5 @@ --- -type: post +layout: post author: alexharding published: true --- @@ -13,7 +13,7 @@ published: true What follows is my python code which allows the user to add their own list of names and choose a file name to write out to. -``` Python +```Python def add_names(list_of_names, file): names_file = open(file, 'a') From 46f57a41d684e5f547d62e067ca1eb9efe60700f Mon Sep 17 00:00:00 2001 From: alexharding Date: Mon, 30 Sep 2013 09:28:36 -0400 Subject: [PATCH 04/89] same as before, fixing jekyl --- _posts/alexharding/2013-09-30-alex-addnames.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/_posts/alexharding/2013-09-30-alex-addnames.md b/_posts/alexharding/2013-09-30-alex-addnames.md index 29faf63..cd16b48 100644 --- a/_posts/alexharding/2013-09-30-alex-addnames.md +++ b/_posts/alexharding/2013-09-30-alex-addnames.md @@ -13,7 +13,7 @@ published: true What follows is my python code which allows the user to add their own list of names and choose a file name to write out to. -```Python +``` def add_names(list_of_names, file): names_file = open(file, 'a') @@ -26,4 +26,5 @@ new_names = input('Type a list of names. ') file_name = input('Type a file name ')+'.txt' add_names(new_names,file_name) print 'This program created '+str(file_name)+' in your home directory.' + ``` From 06a8e97a983d4a18b9a55c5ec6a6a25a9e33dabd Mon Sep 17 00:00:00 2001 From: erholmes Date: Mon, 30 Sep 2013 09:29:45 -0400 Subject: [PATCH 05/89] Create 2013-09-30-erinh-fileio.md Adding Erin's first input/output file stuff. --- _posts/erholmes/2013-09-30-erinh-fileio.md | 34 ++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 _posts/erholmes/2013-09-30-erinh-fileio.md diff --git a/_posts/erholmes/2013-09-30-erinh-fileio.md b/_posts/erholmes/2013-09-30-erinh-fileio.md new file mode 100644 index 0000000..b384828 --- /dev/null +++ b/_posts/erholmes/2013-09-30-erinh-fileio.md @@ -0,0 +1,34 @@ +--- +layout: post +author: erholmes +categories: post +title: Erin H's File I/O +published: true +--- + +Soo it doesn't ask for the filename until the end of the program. But it does ask for it! + +```python +def add_names(list_of_names, file): + """ + Opens and adds a list of names to the end of a file, each on its own line + """ + # We open a file in 'a' mode, for appending to it. + names_file = open(file, 'a') + + # For each line in the list, we print that to the file. + # This assumes one file per line. + for name in list_of_names: + print >> names_file, name + + # Close the file so the changes are visible. + names_file.close() + + +# Exercise: make new_names customizible: +new_names = input('Enter a list of names: '); + +# Exercise: make the file name used here customizible: +add_names(new_names, raw_input('Enter a filename: ')) + +``` From 075112f7346ec2da6ebc5143d2b0438ff82f5817 Mon Sep 17 00:00:00 2001 From: erholmes Date: Mon, 30 Sep 2013 09:30:55 -0400 Subject: [PATCH 06/89] Update 2013-09-30-erinh-fileio.md --- _posts/erholmes/2013-09-30-erinh-fileio.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_posts/erholmes/2013-09-30-erinh-fileio.md b/_posts/erholmes/2013-09-30-erinh-fileio.md index b384828..93d402a 100644 --- a/_posts/erholmes/2013-09-30-erinh-fileio.md +++ b/_posts/erholmes/2013-09-30-erinh-fileio.md @@ -6,7 +6,7 @@ title: Erin H's File I/O published: true --- -Soo it doesn't ask for the filename until the end of the program. But it does ask for it! +So it doesn't ask for the filename until the end of the program, which is not exactly intuitive. But it does ask for it! ```python def add_names(list_of_names, file): From 156a436c89de1e4734f4958feeb39027efb39223 Mon Sep 17 00:00:00 2001 From: Michelle Baxter Date: Mon, 30 Sep 2013 09:34:13 -0400 Subject: [PATCH 07/89] Starting off my python coding exercise post Thing. --- _posts/2013-09-30-python-program.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 _posts/2013-09-30-python-program.md diff --git a/_posts/2013-09-30-python-program.md b/_posts/2013-09-30-python-program.md new file mode 100644 index 0000000..2f7ef6e --- /dev/null +++ b/_posts/2013-09-30-python-program.md @@ -0,0 +1,5 @@ +--- +layout: post +author: mbaxter +category: post +--- From e022a59e5843b11228fff58700e4dd3faefbae59 Mon Sep 17 00:00:00 2001 From: gillenme Date: Mon, 30 Sep 2013 09:47:10 -0400 Subject: [PATCH 08/89] Create 2013_09_30_marys_filenamingexercise.md --- .../2013_09_30_marys_filenamingexercise.md | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 _posts/mgillen/2013_09_30_marys_filenamingexercise.md diff --git a/_posts/mgillen/2013_09_30_marys_filenamingexercise.md b/_posts/mgillen/2013_09_30_marys_filenamingexercise.md new file mode 100644 index 0000000..7b08c9c --- /dev/null +++ b/_posts/mgillen/2013_09_30_marys_filenamingexercise.md @@ -0,0 +1,27 @@ +Shoutout to Jaleesa for the assistance! + +```python + +def add_names(list_of_names, file): + """ + Opens and adds a list of names to the end of a file, each on its own line + """ + # We open a file in 'a' mode, for appending to it. + names_file = open(file, 'a') + + # For each line in the list, we print that to the file. + # This assumes one file per line. + for name in list_of_names: + print >> names_file, name + + # Close the file so the changes are visible. + names_file.close() + + +# Exercise: make new_names customizible: +new_names = input('Enter a list of names: ') +print ('Name written to file') + +# Exercise: make the file name used here customizible: +add_names(new_names, input('Name file: ')) +print ('File named') From 21af9548c1c2b2c53f975311a83bf6b46c635e3d Mon Sep 17 00:00:00 2001 From: Michelle Baxter Date: Mon, 30 Sep 2013 09:49:44 -0400 Subject: [PATCH 09/89] Added photo and text to the post --- _posts/2013-09-30-python-program.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/_posts/2013-09-30-python-program.md b/_posts/2013-09-30-python-program.md index 2f7ef6e..5473d56 100644 --- a/_posts/2013-09-30-python-program.md +++ b/_posts/2013-09-30-python-program.md @@ -3,3 +3,7 @@ layout: post author: mbaxter category: post --- +Here is the screenshot of my terminal window after finishing Excercise Two: +![Ubuntu Screenshot](https://lh4.googleusercontent.com/-tEca61KR_-Y/UkmAn-UgcqI/AAAAAAAAAV0/CcMleZaBLfw/w607-h322-no/Screen+Shot+2013-09-30+at+9.21.54+AM.png "Ubuntu Screenshot") + +A little shoutout to Grant for helping me, with great patience, on that excercise! From 9ef03cabbafba51e953f604929c26f5ea0f7bfa3 Mon Sep 17 00:00:00 2001 From: gillenme Date: Mon, 30 Sep 2013 09:50:57 -0400 Subject: [PATCH 10/89] Update 2013_09_30_marys_filenamingexercise.md --- _posts/mgillen/2013_09_30_marys_filenamingexercise.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/_posts/mgillen/2013_09_30_marys_filenamingexercise.md b/_posts/mgillen/2013_09_30_marys_filenamingexercise.md index 7b08c9c..2dd6c0f 100644 --- a/_posts/mgillen/2013_09_30_marys_filenamingexercise.md +++ b/_posts/mgillen/2013_09_30_marys_filenamingexercise.md @@ -1,3 +1,10 @@ +--- +layout: post +author: mgillen +categories: post +title: Mary's Code for the File Naming Exercise +--- + Shoutout to Jaleesa for the assistance! ```python From b56befb089957a6e745ec6674ba6d2c4f516ebea Mon Sep 17 00:00:00 2001 From: gillenme Date: Mon, 30 Sep 2013 09:52:21 -0400 Subject: [PATCH 11/89] Rename 2013_09_30_marys_filenamingexercise.md to 2013-09-30-marys-filenamingexercise.md --- ...lenamingexercise.md => 2013-09-30-marys-filenamingexercise.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename _posts/mgillen/{2013_09_30_marys_filenamingexercise.md => 2013-09-30-marys-filenamingexercise.md} (100%) diff --git a/_posts/mgillen/2013_09_30_marys_filenamingexercise.md b/_posts/mgillen/2013-09-30-marys-filenamingexercise.md similarity index 100% rename from _posts/mgillen/2013_09_30_marys_filenamingexercise.md rename to _posts/mgillen/2013-09-30-marys-filenamingexercise.md From 128377ab4d6fd7e1409f0e60c62e87066a360950 Mon Sep 17 00:00:00 2001 From: Michelle Baxter Date: Mon, 30 Sep 2013 09:52:55 -0400 Subject: [PATCH 12/89] Spelling error Fixed it. --- _posts/2013-09-30-python-program.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_posts/2013-09-30-python-program.md b/_posts/2013-09-30-python-program.md index 5473d56..2926d72 100644 --- a/_posts/2013-09-30-python-program.md +++ b/_posts/2013-09-30-python-program.md @@ -6,4 +6,4 @@ category: post Here is the screenshot of my terminal window after finishing Excercise Two: ![Ubuntu Screenshot](https://lh4.googleusercontent.com/-tEca61KR_-Y/UkmAn-UgcqI/AAAAAAAAAV0/CcMleZaBLfw/w607-h322-no/Screen+Shot+2013-09-30+at+9.21.54+AM.png "Ubuntu Screenshot") -A little shoutout to Grant for helping me, with great patience, on that excercise! +A little shoutout to Grant for helping me, with great patience, on that exercise! From 2ce3fe58e7a81f5e2ac99903d26e10ae40da4d1d Mon Sep 17 00:00:00 2001 From: Michelle Baxter Date: Mon, 30 Sep 2013 09:53:16 -0400 Subject: [PATCH 13/89] Another spelling error Trying to get it together --- _posts/2013-09-30-python-program.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_posts/2013-09-30-python-program.md b/_posts/2013-09-30-python-program.md index 2926d72..2f5f1fb 100644 --- a/_posts/2013-09-30-python-program.md +++ b/_posts/2013-09-30-python-program.md @@ -3,7 +3,7 @@ layout: post author: mbaxter category: post --- -Here is the screenshot of my terminal window after finishing Excercise Two: +Here is the screenshot of my terminal window after finishing Exercise Two: ![Ubuntu Screenshot](https://lh4.googleusercontent.com/-tEca61KR_-Y/UkmAn-UgcqI/AAAAAAAAAV0/CcMleZaBLfw/w607-h322-no/Screen+Shot+2013-09-30+at+9.21.54+AM.png "Ubuntu Screenshot") A little shoutout to Grant for helping me, with great patience, on that exercise! From 9e64253483a5490a602234bdd8fa3b42b236bddf Mon Sep 17 00:00:00 2001 From: gillenme Date: Mon, 30 Sep 2013 09:56:25 -0400 Subject: [PATCH 14/89] Update 2013-09-30-marys-filenamingexercise.md --- _posts/mgillen/2013-09-30-marys-filenamingexercise.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/_posts/mgillen/2013-09-30-marys-filenamingexercise.md b/_posts/mgillen/2013-09-30-marys-filenamingexercise.md index 2dd6c0f..69aa14b 100644 --- a/_posts/mgillen/2013-09-30-marys-filenamingexercise.md +++ b/_posts/mgillen/2013-09-30-marys-filenamingexercise.md @@ -3,6 +3,7 @@ layout: post author: mgillen categories: post title: Mary's Code for the File Naming Exercise +published: true --- Shoutout to Jaleesa for the assistance! @@ -32,3 +33,4 @@ print ('Name written to file') # Exercise: make the file name used here customizible: add_names(new_names, input('Name file: ')) print ('File named') +``` From 57baaa532c0d072373bd61f1b16a73fffadcaea9 Mon Sep 17 00:00:00 2001 From: Danielle Date: Mon, 30 Sep 2013 10:11:01 -0400 Subject: [PATCH 15/89] Python naming assignment --- _posts/danielle/2013-09-30-PythonNames.md | 32 +++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 _posts/danielle/2013-09-30-PythonNames.md diff --git a/_posts/danielle/2013-09-30-PythonNames.md b/_posts/danielle/2013-09-30-PythonNames.md new file mode 100644 index 0000000..e054e18 --- /dev/null +++ b/_posts/danielle/2013-09-30-PythonNames.md @@ -0,0 +1,32 @@ +--- +layout: post +author: danielle +categories: post +title: Python Naming File +--- +This is what I have done so far with the code for the naming file assignment. It is functional. + +```python +def add_names(list_of_names, file): + """ + Opens and adds a list of names to the end of a file, each on its own line + """ + # We open a file in 'a' mode, for appending to it. + names_file = open(file, 'a') + + # For each line in the list, we print that to the file. + # This assumes one file per line. + for name in list_of_names: + print >> names_file, name + + # Close the file so the changes are visible. + names_file.close() + + +# Exercise: make new_names customizible: +new_names = input('Enter a list of names:') + +# Exercise: make the file name used here customizible: +# This works as long as the user just types in the text file name without brackets or ', ". +add_names(new_names, raw_input('Enter a file name:')) +``` From 61c808bdc34a50389c240afc58181dda626e09e6 Mon Sep 17 00:00:00 2001 From: Dave Pcolar Date: Mon, 30 Sep 2013 10:29:03 -0400 Subject: [PATCH 16/89] Create 2013-09-30-CodingBat-Sum67.md Example solution to List2 Sum67 problem --- _posts/dpcolar/2013-09-30-CodingBat-Sum67.md | 38 ++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 _posts/dpcolar/2013-09-30-CodingBat-Sum67.md diff --git a/_posts/dpcolar/2013-09-30-CodingBat-Sum67.md b/_posts/dpcolar/2013-09-30-CodingBat-Sum67.md new file mode 100644 index 0000000..754b573 --- /dev/null +++ b/_posts/dpcolar/2013-09-30-CodingBat-Sum67.md @@ -0,0 +1,38 @@ +--- +layout: post +author: dpcolar +categories: post +published: True +--- + +* This is my solution to the List2-Sum67 problem: + +``` python + +def sum67(nums): + found_6 = False + sum = 0 + ### Traverse the array with a for loop + for i in range(len(nums)): + ## Make flag true when we find a '6' + if nums[i] == 6: + found_6 = True + ### Continue jumps out of the line code to the bottom of the for loop + continue + + ### If we have already found a '6', we are looking for a 7 before resuming summation + if found_6: + if nums[i] <> 7: + continue + else: + ### A '7' is found, so we turn off the flag and resume summation at the next iteration + found_6 = False + continue + + ### The code never gets here unless we are NOT between 6...7 + sum += nums[i] + return sum + +``` + +* Post questions and I'll respond! From 86de391fdb2c9c1a9390e4657baa296f8e849eda Mon Sep 17 00:00:00 2001 From: Dave Pcolar Date: Mon, 30 Sep 2013 10:32:48 -0400 Subject: [PATCH 17/89] Update 2013-09-30-CodingBat-Sum67.md comments changes --- _posts/dpcolar/2013-09-30-CodingBat-Sum67.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/_posts/dpcolar/2013-09-30-CodingBat-Sum67.md b/_posts/dpcolar/2013-09-30-CodingBat-Sum67.md index 754b573..d9b809a 100644 --- a/_posts/dpcolar/2013-09-30-CodingBat-Sum67.md +++ b/_posts/dpcolar/2013-09-30-CodingBat-Sum67.md @@ -17,7 +17,7 @@ def sum67(nums): ## Make flag true when we find a '6' if nums[i] == 6: found_6 = True - ### Continue jumps out of the line code to the bottom of the for loop + ### Continue jumps out of the line code to the next pass of the for loop continue ### If we have already found a '6', we are looking for a 7 before resuming summation @@ -25,7 +25,7 @@ def sum67(nums): if nums[i] <> 7: continue else: - ### A '7' is found, so we turn off the flag and resume summation at the next iteration + ### A '7' is found, so we turn off the flag and resume summation at the next pass found_6 = False continue From 4db81730c0e7f05228671f54f0171674e93ba30f Mon Sep 17 00:00:00 2001 From: zekuny Date: Mon, 30 Sep 2013 11:01:47 -0400 Subject: [PATCH 18/89] Exercise --- _posts/2013-09-30-zekuny-exercise.md | 37 ++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 _posts/2013-09-30-zekuny-exercise.md diff --git a/_posts/2013-09-30-zekuny-exercise.md b/_posts/2013-09-30-zekuny-exercise.md new file mode 100644 index 0000000..f34edbe --- /dev/null +++ b/_posts/2013-09-30-zekuny-exercise.md @@ -0,0 +1,37 @@ +--- +title: Exercise +layout: post +author: zekuny +categories: post +--- + + +Exercise codes: + +```python + +def add_names(list_of_names, file): + """ + Opens and adds a list of names to the end of a file, each on its own line + """ + # We open a file in 'a' mode, for appending to it. + names_file = open(file, 'a') + + # For each line in the list, we print that to the file. + # This assumes one file per line. + for name in list_of_names: + print >> names_file, name + print name + " written to file" + + # Close the file so the changes are visible. + print "The names have been added successfully" + names_file.close() + + +# Exercise: make new_names customizible: +new_names = input('Enter a list of names:') + +# Exercise: make the file name used here customizible: +file_name = input('Enter a file name:') +add_names(new_names, file_name) +``` From 9f28cff816b9d74dde484a8bd8b0b860bf33981f Mon Sep 17 00:00:00 2001 From: kylerthecreator Date: Mon, 30 Sep 2013 11:36:47 -0400 Subject: [PATCH 19/89] Create 2013-09-30-input-output-exercise.md --- _posts/2013-09-30-input-output-exercise.md | 37 ++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 _posts/2013-09-30-input-output-exercise.md diff --git a/_posts/2013-09-30-input-output-exercise.md b/_posts/2013-09-30-input-output-exercise.md new file mode 100644 index 0000000..32985bf --- /dev/null +++ b/_posts/2013-09-30-input-output-exercise.md @@ -0,0 +1,37 @@ +--- +layout: post +author: kshaffer +categories: post +--- + +Below is my code for the IO exercise from class today. + +```python +def add_names(list_of_names, file): + """ + Opens and adds a list of names to the end of a file, each on its own line + """ + # We open a file in 'a' mode, for appending to it. + names_file = open(file, 'a') + + # For each line in the list, we print that to the file. + # This assumes one file per line. + for name in list_of_names: + print >> names_file, name + + # Close the file so the changes are visible. + names_file.close() + + +# Exercise: make new_names customizible: +# Accept keyboard input from user and assign +# to variable new_names. +new_names = input("Enter a list of names: ") + +# Exercise: make the file name used here customizible: +# Accept keyboard input from the user and assign +# to variable filname. Then pass new variable filename +# to function add_names as second argument. +filename = input("Enter a file name: ") +add_names(new_names, filename) +``` From 23945472aa17b15880e6e351c90da44402cb2aa8 Mon Sep 17 00:00:00 2001 From: kylerthecreator Date: Mon, 30 Sep 2013 11:41:00 -0400 Subject: [PATCH 20/89] Fixed typo in last comments section. --- _posts/2013-09-30-input-output-exercise.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_posts/2013-09-30-input-output-exercise.md b/_posts/2013-09-30-input-output-exercise.md index 32985bf..63a0b41 100644 --- a/_posts/2013-09-30-input-output-exercise.md +++ b/_posts/2013-09-30-input-output-exercise.md @@ -30,7 +30,7 @@ new_names = input("Enter a list of names: ") # Exercise: make the file name used here customizible: # Accept keyboard input from the user and assign -# to variable filname. Then pass new variable filename +# to variable filename. Then pass new variable filename # to function add_names as second argument. filename = input("Enter a file name: ") add_names(new_names, filename) From 34719d08815fb77eec7c103dd20f67ebf90cc84d Mon Sep 17 00:00:00 2001 From: odorsey Date: Mon, 30 Sep 2013 13:15:42 -0400 Subject: [PATCH 21/89] Create 2013-09-30-in-class-exercises.md --- _posts/odorsey/2013-09-30-in-class-exercises.md | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 _posts/odorsey/2013-09-30-in-class-exercises.md diff --git a/_posts/odorsey/2013-09-30-in-class-exercises.md b/_posts/odorsey/2013-09-30-in-class-exercises.md new file mode 100644 index 0000000..470f0ac --- /dev/null +++ b/_posts/odorsey/2013-09-30-in-class-exercises.md @@ -0,0 +1,10 @@ +--- +layout: post +author: odorsey +categories: post +title: In-Class Exercises +--- + +Here is my result from the in-class exercises, thanks in part to Leslie's guidance! + +![CodingBat.com Screenshot](http://img856.imageshack.us/img856/6333/mmnh.jpg) From e770d1d6e5b28d5567ca14a527b8ce639a85dd21 Mon Sep 17 00:00:00 2001 From: odorsey Date: Mon, 30 Sep 2013 13:17:38 -0400 Subject: [PATCH 22/89] Update 2013-09-30-in-class-exercises.md --- _posts/odorsey/2013-09-30-in-class-exercises.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_posts/odorsey/2013-09-30-in-class-exercises.md b/_posts/odorsey/2013-09-30-in-class-exercises.md index 470f0ac..dbacf9d 100644 --- a/_posts/odorsey/2013-09-30-in-class-exercises.md +++ b/_posts/odorsey/2013-09-30-in-class-exercises.md @@ -5,6 +5,6 @@ categories: post title: In-Class Exercises --- -Here is my result from the in-class exercises, thanks in part to Leslie's guidance! +Here is my result from the in-class exercises today, thanks in part to Leslie's guidance! ![CodingBat.com Screenshot](http://img856.imageshack.us/img856/6333/mmnh.jpg) From 720480eacfcf3a605b7599cc24887ce04ebf7cae Mon Sep 17 00:00:00 2001 From: Sarah Date: Mon, 30 Sep 2013 13:21:34 -0400 Subject: [PATCH 23/89] Create 2013-09-30-AddNames Post about homework assignment --- _posts/sburnham/2013-09-30-AddNames | 40 +++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 _posts/sburnham/2013-09-30-AddNames diff --git a/_posts/sburnham/2013-09-30-AddNames b/_posts/sburnham/2013-09-30-AddNames new file mode 100644 index 0000000..bc36eaf --- /dev/null +++ b/_posts/sburnham/2013-09-30-AddNames @@ -0,0 +1,40 @@ +--- +layout: post +author: sburnham +categories: post +title: "Python Add Names Homework" +--- +Here's my code on appending a list and file name. + + +```python + +def add_names(list_of_names, file): + """ + Opens and adds a list of names to the end of a file, each on its own line + """ + # We open a file in 'a' mode, for appending to it. + # Other modes are 'r' for read, 'w' for write, 'b' to append in binary mode, and more + + names_file = open(file, 'a') + + # For each line in the list, we print that to the file. + # This assumes one file per line. + for name in list_of_names: + print >> names_file, name + + # Close the file so the changes are visible. + print file + ' written successfully' + names_file.close() + + +# Exercise: make new_names customizible: +new_names = input('Enter a list of names:') + +# Exercise: make the file name used here customizible: + +file = input('Enter new file name:') + +add_names(new_names, file) + +``` From e586aeb932fd80c35b10a1cf10ba408b251bad39 Mon Sep 17 00:00:00 2001 From: Sarah Date: Mon, 30 Sep 2013 13:24:59 -0400 Subject: [PATCH 24/89] Update 2013-09-30-AddNames --- _posts/sburnham/2013-09-30-AddNames | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/_posts/sburnham/2013-09-30-AddNames b/_posts/sburnham/2013-09-30-AddNames index bc36eaf..db0e670 100644 --- a/_posts/sburnham/2013-09-30-AddNames +++ b/_posts/sburnham/2013-09-30-AddNames @@ -4,8 +4,8 @@ author: sburnham categories: post title: "Python Add Names Homework" --- -Here's my code on appending a list and file name. +Here's my code on appending a list and file name. ```python @@ -27,7 +27,6 @@ def add_names(list_of_names, file): print file + ' written successfully' names_file.close() - # Exercise: make new_names customizible: new_names = input('Enter a list of names:') @@ -36,5 +35,3 @@ new_names = input('Enter a list of names:') file = input('Enter new file name:') add_names(new_names, file) - -``` From 6d645e23e51fbd352d85c387b55a2a31a7e8ed46 Mon Sep 17 00:00:00 2001 From: odorsey Date: Mon, 30 Sep 2013 13:28:36 -0400 Subject: [PATCH 25/89] Update 2013-09-30-in-class-exercises.md Added the actual code instead of the screenshot --- .../odorsey/2013-09-30-in-class-exercises.md | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/_posts/odorsey/2013-09-30-in-class-exercises.md b/_posts/odorsey/2013-09-30-in-class-exercises.md index dbacf9d..ca6175f 100644 --- a/_posts/odorsey/2013-09-30-in-class-exercises.md +++ b/_posts/odorsey/2013-09-30-in-class-exercises.md @@ -7,4 +7,26 @@ title: In-Class Exercises Here is my result from the in-class exercises today, thanks in part to Leslie's guidance! -![CodingBat.com Screenshot](http://img856.imageshack.us/img856/6333/mmnh.jpg) +```python +def add_names(list_of_names, file): + """ + Opens and adds a list of names to the end of file, each on its own line + """ + # We open a file in 'a' mode, for appending to it. + names_file =open(file, 'a') + + # For each line in the list, we print that to the file. + # This assumes one file per line. + for name in list_of_names: + print >> names+files, name + + # Close the file so the changes are visible. + names_file.close() + +# Exercise: make new_names customizible: +new_names= input('Enter a list of names: ') + +# Exercise: make the file name used here customizible: +new_file=input('Enter a file: ') +add_names(new_names, new_file) +``` From 2dad7acf9127e9adef63b4490adb3f369bbb8403 Mon Sep 17 00:00:00 2001 From: leslieho Date: Mon, 30 Sep 2013 16:56:07 -0400 Subject: [PATCH 26/89] Created Add_Names.py code post --- .../lho/2013-09-30-Leslies-Add-Names-Code.md | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 _posts/lho/2013-09-30-Leslies-Add-Names-Code.md diff --git a/_posts/lho/2013-09-30-Leslies-Add-Names-Code.md b/_posts/lho/2013-09-30-Leslies-Add-Names-Code.md new file mode 100644 index 0000000..060c9b7 --- /dev/null +++ b/_posts/lho/2013-09-30-Leslies-Add-Names-Code.md @@ -0,0 +1,34 @@ +--- +layout: post +author: lho +categories: post +--- + +This is my Add_Names.py code! + +```python + +def add_names(list_of_names, file): + """ + Opens and adds a list of names to the end of a file, each on its own line + """ + # We open a file in 'a' mode, for appending to it. + names_file = open(file, 'a') + + # For each line in the list, we print that to the file. + # This assumes one file per line. + for name in list_of_names: + print >> names_file, name + + # Close the file so the changes are visible. + names_file.close() +``` + + + +# Exercise: make new_names customizible: +new_names=input('Enter a list of names:') + +# Exercise: make the file name used here customizible: +customizable_file=input('Enter a file name:') +add_names(new_names, customizable_file) From 7d180a04ae7461ab606e6c8531b3ac97ee90c86b Mon Sep 17 00:00:00 2001 From: leslieho Date: Mon, 30 Sep 2013 16:58:50 -0400 Subject: [PATCH 27/89] Changed the location of the commas --- _posts/lho/2013-09-30-Leslies-Add-Names-Code.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/_posts/lho/2013-09-30-Leslies-Add-Names-Code.md b/_posts/lho/2013-09-30-Leslies-Add-Names-Code.md index 060c9b7..7f8fe20 100644 --- a/_posts/lho/2013-09-30-Leslies-Add-Names-Code.md +++ b/_posts/lho/2013-09-30-Leslies-Add-Names-Code.md @@ -22,7 +22,7 @@ def add_names(list_of_names, file): # Close the file so the changes are visible. names_file.close() -``` + @@ -32,3 +32,5 @@ new_names=input('Enter a list of names:') # Exercise: make the file name used here customizible: customizable_file=input('Enter a file name:') add_names(new_names, customizable_file) + +``` From 073774410ea0c6fd8886075f461ef928c929d091 Mon Sep 17 00:00:00 2001 From: Grant McLendon Date: Mon, 30 Sep 2013 17:35:19 -0400 Subject: [PATCH 28/89] Create 2013-09-30-grant-add_names.md --- _posts/gerbal/2013-09-30-grant-add_names.md | 44 +++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 _posts/gerbal/2013-09-30-grant-add_names.md diff --git a/_posts/gerbal/2013-09-30-grant-add_names.md b/_posts/gerbal/2013-09-30-grant-add_names.md new file mode 100644 index 0000000..1ff35cc --- /dev/null +++ b/_posts/gerbal/2013-09-30-grant-add_names.md @@ -0,0 +1,44 @@ +--- +title: Grant completes add_names.py +layout: post +author: gmclendon +categories: gmclendon +--- + +here's my code: + +```python +import re + +def add_names(list_of_names, file): + """ + Opens and adds a list of names to the end of a file, each on its own line + """ + # We open a file in 'a' mode, for appending to it. + names_file = open(file, 'a') + + # For each line in the list, we print that to the file. + # This assumes one file per line. + for name in list_of_names: + print >> names_file, name + + # Close the file so the changes are visible. + names_file.close() + + +# Exercise: make new_names customizible: +def new_names(): + """ + gets a long string, splits it into a list on non alpha-numeric characters + """ + names = raw_input("What are the names? ") + split_names = re.split('[\W_]+',names) + return split_names + +# Exercise: make the file name used here customizible: +file_name = raw_input("What is the file name? ") + +add_names(new_names(), file_name) +``` + +Added a little bit of functionality. From f7c1b493bde06ebdfd52e957943c78bdc2971589 Mon Sep 17 00:00:00 2001 From: Grant McLendon Date: Mon, 30 Sep 2013 17:37:11 -0400 Subject: [PATCH 29/89] Update 2013-09-30-grant-add_names.md --- _posts/gerbal/2013-09-30-grant-add_names.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_posts/gerbal/2013-09-30-grant-add_names.md b/_posts/gerbal/2013-09-30-grant-add_names.md index 1ff35cc..c2f1995 100644 --- a/_posts/gerbal/2013-09-30-grant-add_names.md +++ b/_posts/gerbal/2013-09-30-grant-add_names.md @@ -2,7 +2,7 @@ title: Grant completes add_names.py layout: post author: gmclendon -categories: gmclendon +categories: post --- here's my code: From b32f65869d41a260f6ffd1fe6bb58b02b9ef5d63 Mon Sep 17 00:00:00 2001 From: Caroline Pate Date: Mon, 30 Sep 2013 17:39:00 -0400 Subject: [PATCH 30/89] Create 2013-9-30-Caroline's-Python-Names.md --- _posts/2013-9-30-Caroline's-Python-Names.md | 33 +++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 _posts/2013-9-30-Caroline's-Python-Names.md diff --git a/_posts/2013-9-30-Caroline's-Python-Names.md b/_posts/2013-9-30-Caroline's-Python-Names.md new file mode 100644 index 0000000..af4b3b5 --- /dev/null +++ b/_posts/2013-9-30-Caroline's-Python-Names.md @@ -0,0 +1,33 @@ +--- +layout: post +author: carolinp +categories: post +--- + + +```python +def add_names(list_of_names, file): + """ + Opens and adds a list of names to the end of a file, each on its own line + """ + # We open a file in 'a' mode, for appending to it. + names_file = open(file, 'a') + + # For each line in the list, we print that to the file. + # This assumes one file per line. + for name in list_of_names: + print >> names_file, name + + # Close the file so the changes are visible. + print 'awesome' + names_file.close() + + +# Exercise: make new_names customizible: +new_names = input('Enter a list of names: ') + +# Exercise: make the file name used here customizible: +file_name = input('Enter a file name: ') +add_names(new_names, file_name) + +``` From 7f4af784cbf1f774f2408e26e7be25487a58aacc Mon Sep 17 00:00:00 2001 From: allhailaugustus Date: Mon, 30 Sep 2013 18:21:01 -0400 Subject: [PATCH 31/89] Create Stacey's text file change post --- .../stacey/2013-09-30-staceys-txt-rename.md | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 _posts/stacey/2013-09-30-staceys-txt-rename.md diff --git a/_posts/stacey/2013-09-30-staceys-txt-rename.md b/_posts/stacey/2013-09-30-staceys-txt-rename.md new file mode 100644 index 0000000..8eb1cc7 --- /dev/null +++ b/_posts/stacey/2013-09-30-staceys-txt-rename.md @@ -0,0 +1,38 @@ +--- +title: Someone's name just went on my... +layout: post +author: smantooth +categories: post +--- + + +.txt file list. + + +```python +def add_names(list_of_names, file): + """ + Opens and adds a list of names to the end of a file, each on its own line + """ + # We open a file in 'a' mode, for appending to it. + names_file = open(file, 'a') + + # For each line in the list, we print that to the file. + # This assumes one file per line. + for name in list_of_names: + print >> names_file, name + + # Close the file so the changes are visible. + names_file.close() + + +# Exercise: make new_names customizible: +new_names = input('Enter a list of names:') + +# Exercise: make the file name used here customizible: +file_name = raw_input('Enter new file name:') +add_names(new_names, file_name) +``` + + +Thanks to Grant and Michelle for helping. From 7f1001393aa74bf80c3752af63c86e0afcb7ce05 Mon Sep 17 00:00:00 2001 From: eipeele Date: Mon, 30 Sep 2013 18:54:33 -0400 Subject: [PATCH 32/89] Create 2013-09-30-Elizabeths-input-post.md --- .../2013-09-30-Elizabeths-input-post.md | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 _posts/epeele/2013-09-30-Elizabeths-input-post.md diff --git a/_posts/epeele/2013-09-30-Elizabeths-input-post.md b/_posts/epeele/2013-09-30-Elizabeths-input-post.md new file mode 100644 index 0000000..abb9585 --- /dev/null +++ b/_posts/epeele/2013-09-30-Elizabeths-input-post.md @@ -0,0 +1,36 @@ +--- +title: Elizabeth's Input Post +layout: post +author: epeele +categories: post +--- + +Here is my input post. + +```python + +def add_names(list_of_names, file): + """ + Opens and adds a list of names to the end of a file, each on its own line + """ + # We open a file in 'a' mode, for appending to it. + names_file = open(file, 'a') + + # For each line in the list, we print that to the file. + # This assumes one file per line. + for name in list_of_names: + print >> names_file, name + + # Close the file so the changes are visible. + print "file written successfully" + names_file.close() + + +# Exercise: make new_names customizible: +new_names = input('Enter a list of names: ') + +# Exercise: make the file name used here customizible: +new_names = raw_input('Enter a filename: ') +add_names(new_names, file_name) + +``` From a8c46014a58ab7efee2339f85da199808dc2d4da Mon Sep 17 00:00:00 2001 From: eipeele Date: Mon, 30 Sep 2013 18:59:15 -0400 Subject: [PATCH 33/89] Update 2013-09-30-Elizabeths-input-post.md --- _posts/epeele/2013-09-30-Elizabeths-input-post.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_posts/epeele/2013-09-30-Elizabeths-input-post.md b/_posts/epeele/2013-09-30-Elizabeths-input-post.md index abb9585..1b25c83 100644 --- a/_posts/epeele/2013-09-30-Elizabeths-input-post.md +++ b/_posts/epeele/2013-09-30-Elizabeths-input-post.md @@ -30,7 +30,7 @@ def add_names(list_of_names, file): new_names = input('Enter a list of names: ') # Exercise: make the file name used here customizible: -new_names = raw_input('Enter a filename: ') +new_names = raw_input('Enter a file name: ') add_names(new_names, file_name) ``` From 1d0ab5b9c1cb45ca3c10879389e6f04f9ab42899 Mon Sep 17 00:00:00 2001 From: Jaleesa Powell Date: Mon, 30 Sep 2013 19:16:16 -0400 Subject: [PATCH 34/89] Create 2013-09-30-JaleesaIOAssignment.md --- _posts/2013-09-30-JaleesaIOAssignment.md | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 _posts/2013-09-30-JaleesaIOAssignment.md diff --git a/_posts/2013-09-30-JaleesaIOAssignment.md b/_posts/2013-09-30-JaleesaIOAssignment.md new file mode 100644 index 0000000..064aaa4 --- /dev/null +++ b/_posts/2013-09-30-JaleesaIOAssignment.md @@ -0,0 +1,10 @@ +--- +layout: post +author: jpowell +categories: post +title: I/O Assignment +--- + +Here's my screenshot: + +![IOScreenshot]('http://i947.photobucket.com/albums/ad316/dieschwarzeskobra/Screenshotfrom2013-09-30190559_zps1ee3c498.png') From 4c56f247b5a52ea46eaed65e58db5faee20fdc01 Mon Sep 17 00:00:00 2001 From: Jaleesa Powell Date: Mon, 30 Sep 2013 19:19:14 -0400 Subject: [PATCH 35/89] Correcting my code to show the image. --- _posts/2013-09-30-JaleesaIOAssignment.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_posts/2013-09-30-JaleesaIOAssignment.md b/_posts/2013-09-30-JaleesaIOAssignment.md index 064aaa4..920089d 100644 --- a/_posts/2013-09-30-JaleesaIOAssignment.md +++ b/_posts/2013-09-30-JaleesaIOAssignment.md @@ -7,4 +7,4 @@ title: I/O Assignment Here's my screenshot: -![IOScreenshot]('http://i947.photobucket.com/albums/ad316/dieschwarzeskobra/Screenshotfrom2013-09-30190559_zps1ee3c498.png') +![IOScreenshot](http://i947.photobucket.com/albums/ad316/dieschwarzeskobra/Screenshotfrom2013-09-30190559_zps1ee3c498.png) From 21ae368dacde24d826ed32db0922743655128e46 Mon Sep 17 00:00:00 2001 From: eipeele Date: Mon, 30 Sep 2013 20:01:19 -0400 Subject: [PATCH 36/89] Update 2013-09-30-Elizabeths-input-post.md removed extra file_name --- _posts/epeele/2013-09-30-Elizabeths-input-post.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_posts/epeele/2013-09-30-Elizabeths-input-post.md b/_posts/epeele/2013-09-30-Elizabeths-input-post.md index 1b25c83..503d8a3 100644 --- a/_posts/epeele/2013-09-30-Elizabeths-input-post.md +++ b/_posts/epeele/2013-09-30-Elizabeths-input-post.md @@ -30,7 +30,7 @@ def add_names(list_of_names, file): new_names = input('Enter a list of names: ') # Exercise: make the file name used here customizible: -new_names = raw_input('Enter a file name: ') +file_name = raw_input('Enter a file name: ') add_names(new_names, file_name) ``` From 1e53003fdd3d834c0931d8360be8e46c9c38a533 Mon Sep 17 00:00:00 2001 From: ashmbrown Date: Mon, 30 Sep 2013 20:14:06 -0400 Subject: [PATCH 37/89] Add Ashley's Input/Output Blog Post --- .../2013-09-30-Input-Output-Exercise.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 _posts/ashmbrown/2013-09-30-Input-Output-Exercise.md diff --git a/_posts/ashmbrown/2013-09-30-Input-Output-Exercise.md b/_posts/ashmbrown/2013-09-30-Input-Output-Exercise.md new file mode 100644 index 0000000..5ace400 --- /dev/null +++ b/_posts/ashmbrown/2013-09-30-Input-Output-Exercise.md @@ -0,0 +1,18 @@ +--- +title: Input/Output In-Class Exercise +layout: post +author: abrown +categories: post +--- +Greetings programmers-to-be, + +I’ve attached my screenshots for today’s in-class assignment. Today was a bit of a struggle for me. I don’t think it helps that I have a nasty head cold that is also not allowing me to process information as well. Additionally, I get overwhelmed when it seems like others are picking this up way faster than I am. However, today I appreciated our discussion about breaking things into smaller pieces and taking it step-by-step. And I think step-by-step is also how I will slowly but surely will start to understand things. I need to do things several times before they click – so that means writing the same pieces of code and doing the same exercises over and over again. + +Anyway, enough babbling on my part… here are my screenshots: + +![input_output_number1](https://lh5.googleusercontent.com/-q86FrQvDtz4/UkoPno_B81I/AAAAAAAAAJ4/SbN259jD26U/w880-h495-no/python_1_inputoutput.jpg) + +![input_output_number2](https://lh4.googleusercontent.com/-QBUr62iuAKg/UkoPrA4s1oI/AAAAAAAAAKA/S33WNPWI_4k/w880-h495-no/python_input_output_2.jpg) + + +-Ashley From cc8983470882f7746972b24eb888e439a4985231 Mon Sep 17 00:00:00 2001 From: landongrindheim Date: Mon, 30 Sep 2013 20:38:30 -0400 Subject: [PATCH 38/89] Removed an s from layout --- _posts/2013-09-25-landons-frustrating-codingbat-exercise.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_posts/2013-09-25-landons-frustrating-codingbat-exercise.md b/_posts/2013-09-25-landons-frustrating-codingbat-exercise.md index 328a8b7..65a578a 100644 --- a/_posts/2013-09-25-landons-frustrating-codingbat-exercise.md +++ b/_posts/2013-09-25-landons-frustrating-codingbat-exercise.md @@ -1,5 +1,5 @@ --- -layout: posts +layout: post author: lgrindheim categories: posts published: True From faec5d7d5c479ee3adb8030c644e6094d996b7d6 Mon Sep 17 00:00:00 2001 From: landongrindheim Date: Mon, 30 Sep 2013 20:39:37 -0400 Subject: [PATCH 39/89] Rename _posts/2013-09-25-landons-frustrating-codingbat-exercise.md to _posts/landon/2013-09-25-landons-frustrating-codingbat-exercise.md --- .../2013-09-25-landons-frustrating-codingbat-exercise.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename _posts/{ => landon}/2013-09-25-landons-frustrating-codingbat-exercise.md (100%) diff --git a/_posts/2013-09-25-landons-frustrating-codingbat-exercise.md b/_posts/landon/2013-09-25-landons-frustrating-codingbat-exercise.md similarity index 100% rename from _posts/2013-09-25-landons-frustrating-codingbat-exercise.md rename to _posts/landon/2013-09-25-landons-frustrating-codingbat-exercise.md From cae41a0d436034879b3c6cdb95bfaf28540f74d0 Mon Sep 17 00:00:00 2001 From: landongrindheim Date: Mon, 30 Sep 2013 20:42:31 -0400 Subject: [PATCH 40/89] Rename _posts/2013-08-26-Landons_Post.md to _posts/landon/2013-08-26-Landons_Post.md --- _posts/{ => landon}/2013-08-26-Landons_Post.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename _posts/{ => landon}/2013-08-26-Landons_Post.md (100%) diff --git a/_posts/2013-08-26-Landons_Post.md b/_posts/landon/2013-08-26-Landons_Post.md similarity index 100% rename from _posts/2013-08-26-Landons_Post.md rename to _posts/landon/2013-08-26-Landons_Post.md From b9d55eb3e69215285296ca05e8ca398517b28556 Mon Sep 17 00:00:00 2001 From: landongrindheim Date: Mon, 30 Sep 2013 20:43:26 -0400 Subject: [PATCH 41/89] Rename _posts/2013-09-04-post-to-be-merged.md to _posts/landon/2013-09-04-post-to-be-merged.md --- _posts/{ => landon}/2013-09-04-post-to-be-merged.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename _posts/{ => landon}/2013-09-04-post-to-be-merged.md (100%) diff --git a/_posts/2013-09-04-post-to-be-merged.md b/_posts/landon/2013-09-04-post-to-be-merged.md similarity index 100% rename from _posts/2013-09-04-post-to-be-merged.md rename to _posts/landon/2013-09-04-post-to-be-merged.md From 605bfa6092da172f1eb30ff8c54f8e7c9c018959 Mon Sep 17 00:00:00 2001 From: Jaleesa Powell Date: Mon, 30 Sep 2013 21:08:42 -0400 Subject: [PATCH 42/89] add Code to my post --- _posts/2013-09-30-JaleesaIOAssignment.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/_posts/2013-09-30-JaleesaIOAssignment.md b/_posts/2013-09-30-JaleesaIOAssignment.md index 920089d..28622e0 100644 --- a/_posts/2013-09-30-JaleesaIOAssignment.md +++ b/_posts/2013-09-30-JaleesaIOAssignment.md @@ -8,3 +8,27 @@ title: I/O Assignment Here's my screenshot: ![IOScreenshot](http://i947.photobucket.com/albums/ad316/dieschwarzeskobra/Screenshotfrom2013-09-30190559_zps1ee3c498.png) + +``` python +def add_names(list_of_names, file): + """ + Opens and adds a list of names to the end of a file, each on its own line + """ + # We open a file in 'a' mode, for appending to it. + names_file = open(file, 'a') + + # For each line in the list, we print that to the file. + # This assumes one file per line. + for name in list_of_names: + print >> names_file, name + + # Close the file so the changes are visible. + names_file.close() + + +# Exercise: make new_names customizible: +new_names = input('Enter a list of names: ') + +# Exercise: make the file name used here customizible: +add_names(new_names, input('Enter the file name: ')) +``` From 7e0d0329bc20213b4c0fb79661802bbe36911fe3 Mon Sep 17 00:00:00 2001 From: landongrindheim Date: Mon, 30 Sep 2013 21:28:30 -0400 Subject: [PATCH 43/89] Rename _posts/2013-09-08-Pythonic-Idioms.md to _posts/landon/2013-09-08-Pythonic-Idioms.md --- _posts/{ => landon}/2013-09-08-Pythonic-Idioms.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename _posts/{ => landon}/2013-09-08-Pythonic-Idioms.md (100%) diff --git a/_posts/2013-09-08-Pythonic-Idioms.md b/_posts/landon/2013-09-08-Pythonic-Idioms.md similarity index 100% rename from _posts/2013-09-08-Pythonic-Idioms.md rename to _posts/landon/2013-09-08-Pythonic-Idioms.md From 46df018b634ece4c24b466abe2b8d51d1c2f6512 Mon Sep 17 00:00:00 2001 From: landongrindheim Date: Mon, 30 Sep 2013 21:29:13 -0400 Subject: [PATCH 44/89] Rename _posts/2013-09-09-landons-turtle-drawing-newdrawing.md to _posts/landon/2013-09-09-landons-turtle-drawing-newdrawing.md --- .../{ => landon}/2013-09-09-landons-turtle-drawing-newdrawing.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename _posts/{ => landon}/2013-09-09-landons-turtle-drawing-newdrawing.md (100%) diff --git a/_posts/2013-09-09-landons-turtle-drawing-newdrawing.md b/_posts/landon/2013-09-09-landons-turtle-drawing-newdrawing.md similarity index 100% rename from _posts/2013-09-09-landons-turtle-drawing-newdrawing.md rename to _posts/landon/2013-09-09-landons-turtle-drawing-newdrawing.md From d1969448782f2ef4b862cbcb833ed0d347e890d8 Mon Sep 17 00:00:00 2001 From: jkgeer Date: Mon, 30 Sep 2013 21:33:21 -0400 Subject: [PATCH 45/89] Created my input solutions --- _posts/2013-09-30-input.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 _posts/2013-09-30-input.md diff --git a/_posts/2013-09-30-input.md b/_posts/2013-09-30-input.md new file mode 100644 index 0000000..e3207c0 --- /dev/null +++ b/_posts/2013-09-30-input.md @@ -0,0 +1,27 @@ +--- +layout: post +username: jgeer +categories: post +--- + +def add_names(list_of_names, file): + """ + Opens and adds a list of names to the end of file, each on its own line + """ + # We open a file in 'a' mode, for appending to it. + names_file =open(file, 'a') + + # For each line in the list, we print that to the file. + # This assumes one file per line. + for name in list_of_names: + print >> names+files, name + + # Close the file so the changes are visible. + names_file.close() + +# Exercise: make new_names customizable: +new_names= input('Enter a list of names: ') + +# Exercise: make the file name used here customizable: +new_file= input('Enter a file: ') +add_names(new_names, new_file) From 5d006717e180c41e2ea93031854387aff9a8323a Mon Sep 17 00:00:00 2001 From: Dave Pcolar Date: Mon, 30 Sep 2013 21:35:16 -0400 Subject: [PATCH 46/89] Create 2013-09-30-Programming-Assignment.md Class Eleven programming assignment --- .../2013-09-30-Programming-Assignment.md | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 _posts/dpcolar/2013-09-30-Programming-Assignment.md diff --git a/_posts/dpcolar/2013-09-30-Programming-Assignment.md b/_posts/dpcolar/2013-09-30-Programming-Assignment.md new file mode 100644 index 0000000..9ed9e84 --- /dev/null +++ b/_posts/dpcolar/2013-09-30-Programming-Assignment.md @@ -0,0 +1,45 @@ +--- +title: Programming Assignment - Eleventh Class +layout: post +author: dpcolar +categories: post code +--- + +``` python + +def add_names(list_of_names, file): + """ + Opens and adds a list of names to the end of a file, each on its own line + """ + # We open a file in 'a' mode, for appending to it. + names_file = open(file, 'a') + + # For each line in the list, we print that to the file. + # This assumes one name per line. + for name in list_of_names: + print >> names_file, name + print "name added: " + name + + # Close the file so the changes are visible. + print "to file: " + file + names_file.close() + +### Main Code starts Here +new_names = input("enter new names:") + +new_file = raw_input("enter the filename to append:") +add_names(new_names, new_file) + +``` + +Results: + +>>> python add_names.py +enter new names:['Tim', 'Jill', 'Jeff', 'Pedro', 'Adam'] +enter the filename to append:names.txt +name added: Tim +name added: Jill +name added: Jeff +name added: Pedro +name added: Adam +to file: names.txt From 04c67e023dfc70f0f778ba13c39831b90d9400b3 Mon Sep 17 00:00:00 2001 From: landongrindheim Date: Mon, 30 Sep 2013 21:36:09 -0400 Subject: [PATCH 47/89] Create 2013-09-30-landons-naming-file.md --- .../landon/2013-09-30-landons-naming-file.md | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 _posts/landon/2013-09-30-landons-naming-file.md diff --git a/_posts/landon/2013-09-30-landons-naming-file.md b/_posts/landon/2013-09-30-landons-naming-file.md new file mode 100644 index 0000000..4d41345 --- /dev/null +++ b/_posts/landon/2013-09-30-landons-naming-file.md @@ -0,0 +1,30 @@ +--- +layout: post +author: lgrindheim +categories: posts +--- + + +``` +def add_names(list_of_names, file): + """ + Opens and adds a list of names to the end of a file, each on its own line + """ + # We open a file in 'a' mode, for appending to it. + names_file = input(file, 'enter a file name!') + + # For each line in the list, we print that to the file. + # This assumes one file per line. + for name in list_of_names: + print >> names_file, name + + # Close the file so the changes are visible. + names_file.close() + + +# Exercise: make new_names customizible: +new_names = input('enter some names!') + +# Exercise: make the file name used here customizible: +add_names(new_names, 'names.txt') +``` From 71ce36937cfff9dfc8f5732df6420272688c3538 Mon Sep 17 00:00:00 2001 From: Dave Pcolar Date: Mon, 30 Sep 2013 21:37:24 -0400 Subject: [PATCH 48/89] Update 2013-09-30-Programming-Assignment.md Formatting changes --- .../dpcolar/2013-09-30-Programming-Assignment.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/_posts/dpcolar/2013-09-30-Programming-Assignment.md b/_posts/dpcolar/2013-09-30-Programming-Assignment.md index 9ed9e84..f1ee41a 100644 --- a/_posts/dpcolar/2013-09-30-Programming-Assignment.md +++ b/_posts/dpcolar/2013-09-30-Programming-Assignment.md @@ -34,12 +34,12 @@ add_names(new_names, new_file) Results: ->>> python add_names.py -enter new names:['Tim', 'Jill', 'Jeff', 'Pedro', 'Adam'] -enter the filename to append:names.txt -name added: Tim -name added: Jill -name added: Jeff -name added: Pedro -name added: Adam +>>> python add_names.py
+enter new names:['Tim', 'Jill', 'Jeff', 'Pedro', 'Adam']
+enter the filename to append:names.txt
+name added: Tim
+name added: Jill
+name added: Jeff
+name added: Pedro
+name added: Adam
to file: names.txt From f84700b34212cfa066010649fefd3d453e3d0e93 Mon Sep 17 00:00:00 2001 From: landongrindheim Date: Mon, 30 Sep 2013 21:37:58 -0400 Subject: [PATCH 49/89] Rename _posts/2013-09-18-codingbat-screenshot.md to _posts/landon/2013-09-18-codingbat-screenshot.md --- _posts/{ => landon}/2013-09-18-codingbat-screenshot.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename _posts/{ => landon}/2013-09-18-codingbat-screenshot.md (100%) diff --git a/_posts/2013-09-18-codingbat-screenshot.md b/_posts/landon/2013-09-18-codingbat-screenshot.md similarity index 100% rename from _posts/2013-09-18-codingbat-screenshot.md rename to _posts/landon/2013-09-18-codingbat-screenshot.md From 979d7b3ec6a9dd0126f83262f59ad30b92000163 Mon Sep 17 00:00:00 2001 From: ans729 Date: Mon, 30 Sep 2013 22:40:46 -0400 Subject: [PATCH 50/89] Create 2013-09-30-asherman-ioexercise.md --- _posts/asherman/2013-09-30-asherman-ioexercise.md | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 _posts/asherman/2013-09-30-asherman-ioexercise.md diff --git a/_posts/asherman/2013-09-30-asherman-ioexercise.md b/_posts/asherman/2013-09-30-asherman-ioexercise.md new file mode 100644 index 0000000..4f41d03 --- /dev/null +++ b/_posts/asherman/2013-09-30-asherman-ioexercise.md @@ -0,0 +1,10 @@ +--- +title: I/O Exercise +layout: post +author: asherman +categories: post +--- + +Thanks for the help Michelle! + +![Ubuntu Screenshot](http://farm8.staticflickr.com/7345/10030634034_5d19e2f02e.jpg) From 6ad7480fda0f0562e9554e9669f4d1058988f5ac Mon Sep 17 00:00:00 2001 From: Elliott Hauser Date: Wed, 2 Oct 2013 07:59:16 -0400 Subject: [PATCH 51/89] Twelfth class notes. --- _posts/elliott/2013-10-02-twelfth-class.md | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 _posts/elliott/2013-10-02-twelfth-class.md diff --git a/_posts/elliott/2013-10-02-twelfth-class.md b/_posts/elliott/2013-10-02-twelfth-class.md new file mode 100644 index 0000000..5aef5cd --- /dev/null +++ b/_posts/elliott/2013-10-02-twelfth-class.md @@ -0,0 +1,24 @@ +--- +layout: post +author: elliott +title: Twelfth Class Notes +--- + +## Announcements +* Github check in. Merge from master +* G+ check in +* Python [built-in functions](http://docs.python.org/library/functions.html) + +Questions? + +## Command line git + +[http://try.github.io](http://try.github.io) + +## Turtlehack + +[https://github.com/silshack/fall2013turtlehack](https://github.com/silshack/fall2013turtlehack) + +Exercise: pick a function, open an issue, and implement. + +Next week: finish Turtlehacking by refactoring our original programs. Want to work ahead? Download and import turtlehack and do another drawing. From 9f35338b757d49c648389379b0fc3ebc629526f3 Mon Sep 17 00:00:00 2001 From: landongrindheim Date: Wed, 2 Oct 2013 08:08:57 -0400 Subject: [PATCH 52/89] added line between backticks and first character --- _posts/landon/2013-09-30-landons-naming-file.md | 1 + 1 file changed, 1 insertion(+) diff --git a/_posts/landon/2013-09-30-landons-naming-file.md b/_posts/landon/2013-09-30-landons-naming-file.md index 4d41345..98a53a7 100644 --- a/_posts/landon/2013-09-30-landons-naming-file.md +++ b/_posts/landon/2013-09-30-landons-naming-file.md @@ -6,6 +6,7 @@ categories: posts ``` + def add_names(list_of_names, file): """ Opens and adds a list of names to the end of a file, each on its own line From 401605f7c70c10ab41cfe5bdda09aed426319136 Mon Sep 17 00:00:00 2001 From: eah13 Date: Sun, 6 Oct 2013 22:15:41 -0400 Subject: [PATCH 53/89] Schedule updates (mostly speakers) --- schedule.markdown | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/schedule.markdown b/schedule.markdown index f932768..9451d45 100644 --- a/schedule.markdown +++ b/schedule.markdown @@ -275,6 +275,8 @@ Wednesday Oct 9th: Graphical Text Editors - IDLE, SublimeText, Eclipse, others? * In-class: More command line git +Guest Speaker: Eric Martindale + ### Week 9: Problem Solving with Libraries and Frameworks Problem solving with code, but better. Guests. @@ -315,6 +317,8 @@ Wednesday Oct 23rd: Other languages and technology: Ruby, Java, HTML, CSS, Javas * Reading: Interview with Bjarne Stroustrup - [Elegance and other Design Ideals](http://www.artima.com/intv/elegance.html). Stroustrup invented C++ in the 70s and 80s. +* Guest Speaker: Jeff Heard, RENCI + * In-class: Brainstorm 3 project ideas & lightning talks ### Week 11: Networked Computing From 970c54fe92881cd69203f1628649b3a70aa0507b Mon Sep 17 00:00:00 2001 From: eah13 Date: Sun, 6 Oct 2013 23:07:56 -0400 Subject: [PATCH 54/89] Thirteenth class notes --- _posts/elliott/2013-10-07-thirteenth-class.md | 79 +++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 _posts/elliott/2013-10-07-thirteenth-class.md diff --git a/_posts/elliott/2013-10-07-thirteenth-class.md b/_posts/elliott/2013-10-07-thirteenth-class.md new file mode 100644 index 0000000..a8ea6c3 --- /dev/null +++ b/_posts/elliott/2013-10-07-thirteenth-class.md @@ -0,0 +1,79 @@ +--- +layout: post +author: elliott +title: Thirteenth Class Notes +--- + +Announcements: + +* Github looking good (Merge @gerbal's pull request) +* G+ check in +* Local git installs, Jekyll, and site hacking oh my! +* Guest Eric Martindale on Weds, so vim & emacs that day. + +## Installing `git` + +Git is the open source version control program that underlies the Github collaboration website. We tried it last week, now we'll install and use it. + +Installing git on Ubuntu is super easy. From a Terminal, type +``` +sudo apt-get install git +``` + +Some tutorials might tell you to install `git-core`, which will work too. To check whether git is installed, type +``` +which git +``` +`which` is a UNIX program that locates the location of the file that would be run if you typed a command. It's useful for checking if you have a program installed and, if so, where it is. + +## Cloning your first repo + +Github does a pretty good job making it easy to clone repos. In the bottom right of every project page there is a box with the URL you'll need to clone. The syntax for cloning is +``` +git clone URL +``` +In the case of the [turtlehack repo](https://github.com/silshack/fall2013turtlehack) the URL is https://github.com/silshack/fall2013turtlehack.git. It's essentially the project's URL with a `.git` on the end. + +Go ahead and clone turtlehack: + +1. Open a terminal +2. Type `git clone https://github.com/silshack/fall2013turtlehack.git` +3. Type `cd fall2013turtlehack` to **change directories** into the folder git just created for you +4. Type `ls` to see what's in there. + +## Using a library + +There's a file in the repo we cloned called `turtlehack.py` that has code we can use in it. We can access it in python by importing it. + +1. Fire up python by typing `python` in a terminal. +2. from the `>>>` prompt type `import turtlehack` +3. you can then use custom functions by typing `turtlehack.functionname()`. For instance, after importing the turtlehack library, we could use the `random_color()` function by typing `turtlehack.random_color()` + +## Turtlehacking + +So let's see what we can do! Type each line in sequence at a python prompt (`>>>`), then play around yourself. + +```python +import turtle +import turtlehack + +roger = turtle.Turtle() + +# draw a circle +roger.circle(20) + +# random_color() returns a color value, so we put it where we'd normally put a color. +# you should see the 'turtle' chance colors at this point. +roger.color(random_color()) + +# draw another circle, slightly different in size, and see the different color! +roger.circle(30) +``` + +## Contributing + +`random_color()` is pretty sweet, but there are lots of improvements we can make to the Turtlehack project. Check out the Issues of the project to see what the organizer has identified as things that need improvement. + +## Exercise due Wednesday + +By the end of Wednesday, particpate in the Turtlehack project in a meaningful way, and post a post showing how you've used the library to make a better Turtle drawing. Your post should have 1) a screenshot and 2) your code. From a72647f23d7a35c9e3ecd985f86bb3b117abde4a Mon Sep 17 00:00:00 2001 From: eah13 Date: Sun, 6 Oct 2013 23:12:45 -0400 Subject: [PATCH 55/89] Add emacs reading --- schedule.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/schedule.markdown b/schedule.markdown index 9451d45..1dbfc87 100644 --- a/schedule.markdown +++ b/schedule.markdown @@ -257,7 +257,7 @@ Monday Oct 7th: Terminal Text Editors - Nano, Vim, and Emacs 1. Reading: [Vim after 11 years](http://statico.github.io/vim.html) -2. Reading: TBD Emacs +2. Reading: [My Emacs Workflow](http://blog.zenspider.com/blog/2012/06/my-emacs-workflow.html) * In class: Use and customize Nano From d8a36478cf8eb33ef65b973d5b5317526650b99f Mon Sep 17 00:00:00 2001 From: eah13 Date: Sun, 6 Oct 2013 23:14:31 -0400 Subject: [PATCH 56/89] Feedback thanks --- _posts/elliott/2013-10-07-thirteenth-class.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/_posts/elliott/2013-10-07-thirteenth-class.md b/_posts/elliott/2013-10-07-thirteenth-class.md index a8ea6c3..875cdd5 100644 --- a/_posts/elliott/2013-10-07-thirteenth-class.md +++ b/_posts/elliott/2013-10-07-thirteenth-class.md @@ -8,8 +8,10 @@ Announcements: * Github looking good (Merge @gerbal's pull request) * G+ check in +* Thanks for the feedback - keep it coming * Local git installs, Jekyll, and site hacking oh my! -* Guest Eric Martindale on Weds, so vim & emacs that day. +* Guest Eric Martindale on Weds, so vim & emacs that day. See Emacs reading [here](http://blog.zenspider.com/blog/2012/06/my-emacs-workflow.html) +* See exercise due Wednesday, below. ## Installing `git` From 3902d2680f562cd4364cea4e302de9342f3ff1b1 Mon Sep 17 00:00:00 2001 From: Dave Pcolar Date: Mon, 7 Oct 2013 23:09:01 -0400 Subject: [PATCH 57/89] Create 2013-10-07-assignment N-sided polygon assignment --- _posts/dpcolar/2013-10-07-assignment | 59 ++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 _posts/dpcolar/2013-10-07-assignment diff --git a/_posts/dpcolar/2013-10-07-assignment b/_posts/dpcolar/2013-10-07-assignment new file mode 100644 index 0000000..ad09465 --- /dev/null +++ b/_posts/dpcolar/2013-10-07-assignment @@ -0,0 +1,59 @@ +--- +layout: post +author: dpcolar +title: Implement the n-sided polygon +categories: post +--- + +The n-sided polygon is implemented using turtlehack. +
+ +```python + +import turtle +import turtlehack +import random + +# A function that draws an n-sided polygon +def n_sided_polygon(turtle, n, color="#FFFFFF", line_thickness=1): + ''' + Draw an n-sided polygon + input: turtle, n, line_length + ''' + # for n times: + # Draw a line, then turn 360/n degrees and draw another + + # set initial parameters +   turtle.degrees() + line_length=80 +   turtle.pensize(line_thickness) +   turn_angle = (360/n) +   i = 1 + + # Draw each line segment and turn + +   while (i <= n): + turtle.color(color) +     turtle.pendown() +     turtle.forward(line_length) +    turtle.penup() +     turtle.right(turn_angle) +     i += 1 + + return 0 +  +## MAIN ## +# set initial parameters +n=random.randint(3,12) + +# create the Turle instance +graphic = turtle.Turtle() +# Call the polygon code +n_sided_polygon(graphic, n, turtlehack.random_color(), random.randint(4,8)) + +# Close and exit +ignore = raw_input("hit any key to continue:") + +``` + +[!http://www.unc.edu/~pcolar/n_sided_polygon.png N-sided Polygon] From 60e7f20bb7ac0d508a7b8435abac28e8b4ad1fb3 Mon Sep 17 00:00:00 2001 From: Dave Pcolar Date: Mon, 7 Oct 2013 23:11:18 -0400 Subject: [PATCH 58/89] Rename 2013-10-07-assignment to 2013-10-07-assignment.md name correction. it must be getting late... --- .../dpcolar/{2013-10-07-assignment => 2013-10-07-assignment.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename _posts/dpcolar/{2013-10-07-assignment => 2013-10-07-assignment.md} (100%) diff --git a/_posts/dpcolar/2013-10-07-assignment b/_posts/dpcolar/2013-10-07-assignment.md similarity index 100% rename from _posts/dpcolar/2013-10-07-assignment rename to _posts/dpcolar/2013-10-07-assignment.md From 842c15418689fdb5f1523cfd607e9b44cf2e2dee Mon Sep 17 00:00:00 2001 From: Dave Pcolar Date: Mon, 7 Oct 2013 23:13:28 -0400 Subject: [PATCH 59/89] Update 2013-10-07-assignment.md Third time is a charm --- _posts/dpcolar/2013-10-07-assignment.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_posts/dpcolar/2013-10-07-assignment.md b/_posts/dpcolar/2013-10-07-assignment.md index ad09465..0452173 100644 --- a/_posts/dpcolar/2013-10-07-assignment.md +++ b/_posts/dpcolar/2013-10-07-assignment.md @@ -56,4 +56,4 @@ ignore = raw_input("hit any key to continue:") ``` -[!http://www.unc.edu/~pcolar/n_sided_polygon.png N-sided Polygon] +![http://www.unc.edu/~pcolar/n_sided_polygon.png N-sided Polygon] From 58e181cb9df0174a696f9bef6de53b586b0f994b Mon Sep 17 00:00:00 2001 From: Dave Pcolar Date: Mon, 7 Oct 2013 23:16:49 -0400 Subject: [PATCH 60/89] Update 2013-10-07-assignment.md --- _posts/dpcolar/2013-10-07-assignment.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_posts/dpcolar/2013-10-07-assignment.md b/_posts/dpcolar/2013-10-07-assignment.md index 0452173..bb644b8 100644 --- a/_posts/dpcolar/2013-10-07-assignment.md +++ b/_posts/dpcolar/2013-10-07-assignment.md @@ -56,4 +56,4 @@ ignore = raw_input("hit any key to continue:") ``` -![http://www.unc.edu/~pcolar/n_sided_polygon.png N-sided Polygon] +![http://www.unc.edu/~pcolar/n\_sided\_polygon.png N-sided Polygon] From d4380d54b277e0710fd85267c70e2c1373daba07 Mon Sep 17 00:00:00 2001 From: Dave Pcolar Date: Mon, 7 Oct 2013 23:18:20 -0400 Subject: [PATCH 61/89] Update 2013-10-07-assignment.md One more time - to fix the URL --- _posts/dpcolar/2013-10-07-assignment.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_posts/dpcolar/2013-10-07-assignment.md b/_posts/dpcolar/2013-10-07-assignment.md index bb644b8..29703a7 100644 --- a/_posts/dpcolar/2013-10-07-assignment.md +++ b/_posts/dpcolar/2013-10-07-assignment.md @@ -56,4 +56,4 @@ ignore = raw_input("hit any key to continue:") ``` -![http://www.unc.edu/~pcolar/n\_sided\_polygon.png N-sided Polygon] +![http://www.unc.edu/~pcolar/nsidedpolygon.png N-sided Polygon] From 41c928cd3fd781e45cb517185d0170b75cdabb68 Mon Sep 17 00:00:00 2001 From: Dave Pcolar Date: Mon, 7 Oct 2013 23:19:55 -0400 Subject: [PATCH 62/89] Update 2013-10-07-assignment.md --- _posts/dpcolar/2013-10-07-assignment.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_posts/dpcolar/2013-10-07-assignment.md b/_posts/dpcolar/2013-10-07-assignment.md index 29703a7..427361e 100644 --- a/_posts/dpcolar/2013-10-07-assignment.md +++ b/_posts/dpcolar/2013-10-07-assignment.md @@ -56,4 +56,4 @@ ignore = raw_input("hit any key to continue:") ``` -![http://www.unc.edu/~pcolar/nsidedpolygon.png N-sided Polygon] +![N-sided Polygon](http://www.unc.edu/~pcolar/nsidedpolygon.png) From 53c716f0f464139c9bb4d8ca011e667e32cd3fc0 Mon Sep 17 00:00:00 2001 From: Dave Pcolar Date: Tue, 8 Oct 2013 08:00:56 -0400 Subject: [PATCH 63/89] Update 2013-10-07-assignment.md More typos in the documentation --- _posts/dpcolar/2013-10-07-assignment.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/_posts/dpcolar/2013-10-07-assignment.md b/_posts/dpcolar/2013-10-07-assignment.md index 427361e..bcec23d 100644 --- a/_posts/dpcolar/2013-10-07-assignment.md +++ b/_posts/dpcolar/2013-10-07-assignment.md @@ -18,7 +18,7 @@ import random def n_sided_polygon(turtle, n, color="#FFFFFF", line_thickness=1): ''' Draw an n-sided polygon - input: turtle, n, line_length + input: turtle, number of sides, line color, line thickness ''' # for n times: # Draw a line, then turn 360/n degrees and draw another @@ -46,7 +46,7 @@ def n_sided_polygon(turtle, n, color="#FFFFFF", line_thickness=1): # set initial parameters n=random.randint(3,12) -# create the Turle instance +# create the Turtle instance graphic = turtle.Turtle() # Call the polygon code n_sided_polygon(graphic, n, turtlehack.random_color(), random.randint(4,8)) From 0c8182d2b7ee8914cb20304dca2dc9aabeb36df8 Mon Sep 17 00:00:00 2001 From: eah13 Date: Tue, 8 Oct 2013 18:27:39 -0400 Subject: [PATCH 64/89] Friday extension; Git setup --- _posts/elliott/2013-10-07-thirteenth-class.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/_posts/elliott/2013-10-07-thirteenth-class.md b/_posts/elliott/2013-10-07-thirteenth-class.md index 875cdd5..7e2fb3d 100644 --- a/_posts/elliott/2013-10-07-thirteenth-class.md +++ b/_posts/elliott/2013-10-07-thirteenth-class.md @@ -28,6 +28,10 @@ which git ``` `which` is a UNIX program that locates the location of the file that would be run if you typed a command. It's useful for checking if you have a program installed and, if so, where it is. +## NEW: First- Time Setup + +Git has an excellent first-time git setup turorial [here](https://help.github.com/articles/set-up-git#set-up-git). We did this during class and you should too if you're making up the work. + ## Cloning your first repo Github does a pretty good job making it easy to clone repos. In the bottom right of every project page there is a box with the URL you'll need to clone. The syntax for cloning is @@ -76,6 +80,6 @@ roger.circle(30) `random_color()` is pretty sweet, but there are lots of improvements we can make to the Turtlehack project. Check out the Issues of the project to see what the organizer has identified as things that need improvement. -## Exercise due Wednesday +## Exercise due Friday -By the end of Wednesday, particpate in the Turtlehack project in a meaningful way, and post a post showing how you've used the library to make a better Turtle drawing. Your post should have 1) a screenshot and 2) your code. +By the end of Friday, particpate in the Turtlehack project in a meaningful way, and post a post showing how you've used the library to make a better Turtle drawing. Your post should have 1) a screenshot and 2) your code. From 33a9eac6468e32cc501d9bc89b12d6f92f7965f5 Mon Sep 17 00:00:00 2001 From: eah13 Date: Wed, 9 Oct 2013 18:18:43 -0400 Subject: [PATCH 65/89] Added example post --- .../elliott/2013-10-09-Example-Turtlehack.md | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 _posts/elliott/2013-10-09-Example-Turtlehack.md diff --git a/_posts/elliott/2013-10-09-Example-Turtlehack.md b/_posts/elliott/2013-10-09-Example-Turtlehack.md new file mode 100644 index 0000000..1e5761b --- /dev/null +++ b/_posts/elliott/2013-10-09-Example-Turtlehack.md @@ -0,0 +1,44 @@ +--- +author: elliott +layout: post +--- + + +Here's my Turtlehack: + +![](http://puu.sh/4LZtG.png) + +Generated off of this code: + +``` +import turtle +from turtlehack import * +import random + +cruz = turtle.Turtle() + +# Speeds us up: +cruz.speed(10) + +# Make a bunch of random circles +for i in range(random.randint(0,10)): + random_location(cruz, 300, 300) + cruz.color(random_color()) + random_circle(cruz, 5, 15) + +# Go back to the origin and make the last circle +random_location(cruz, 0, 0) +cruz.color(random_color()) +random_circle(cruz, 5, 15) + +words = ['random', 'tuna salad', 'Mark Hamil', 'mug', 'narwhal', 'carpet'] +for i in range(random.randint(0,10)): + rando_word = random.choice(words) + cruz.penup() + cruz.color(random_color()) + random_location(cruz, 250, 205) + cruz.write(rando_word) + cruz.pendown() + +turtle.done() +``` \ No newline at end of file From f83585abe2b9bb2e69b82a4355f53fe4163d40a5 Mon Sep 17 00:00:00 2001 From: odorsey Date: Thu, 10 Oct 2013 19:28:34 -0400 Subject: [PATCH 66/89] Create 2013-10-10-turtlehack-post.md --- _posts/odorsey/2013-10-10-turtlehack-post.md | 27 ++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 _posts/odorsey/2013-10-10-turtlehack-post.md diff --git a/_posts/odorsey/2013-10-10-turtlehack-post.md b/_posts/odorsey/2013-10-10-turtlehack-post.md new file mode 100644 index 0000000..e7cfab0 --- /dev/null +++ b/_posts/odorsey/2013-10-10-turtlehack-post.md @@ -0,0 +1,27 @@ +--- +title: Turtle Circle Crazy Party +layout: post +author: odorsey +categories: post +--- +Here's my turtlehack picture! +![Turtlehack Picture](http://img9.imageshack.us/img9/9534/l1ir.jpg) + +And my corresponding code... + +```python +import turtle +import turtlehack +import random + +larry = turtle.Turtle() + +for i in range(random.randint(0,10)): + larry.color(turtlehack.random_color()) + turtlehack.random_circle(larry, 10, 15) + turtlehack.random_location(larry, 125, 125) +larry.color(turtlehack.random_color()) +turtlehack.random_circle(larry, 34, 10) + +turtle.done() +``` From 554b0ff062f46fd4fc71d10122fdeefd41afac4d Mon Sep 17 00:00:00 2001 From: odorsey Date: Thu, 10 Oct 2013 19:31:15 -0400 Subject: [PATCH 67/89] Create 2013-10-10-turtlehack.md --- _posts/odorsey/2013-10-10-turtlehack.md | 27 +++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 _posts/odorsey/2013-10-10-turtlehack.md diff --git a/_posts/odorsey/2013-10-10-turtlehack.md b/_posts/odorsey/2013-10-10-turtlehack.md new file mode 100644 index 0000000..2f88ab3 --- /dev/null +++ b/_posts/odorsey/2013-10-10-turtlehack.md @@ -0,0 +1,27 @@ +--- +title: Turtle Circle Crazy Party +layout: post +author: odorsey +categories: post +--- +Here's my turtlehack picture! +![Turtlehack Picture](http://img9.imageshack.us/img9/9534/l1ir.jpg "Turtlehack picture") + +And my corresponding code... + +```python +import turtle +import turtlehack +import random + +larry = turtle.Turtle() + +for i in range(random.randint(0,10)): + larry.color(turtlehack.random_color()) + turtlehack.random_circle(larry, 10, 15) + turtlehack.random_location(larry, 125, 125) +larry.color(turtlehack.random_color()) +turtlehack.random_circle(larry, 34, 10) + +turtle.done() +``` From 52d842b79458ceb0e961a46b8576be53fff48eab Mon Sep 17 00:00:00 2001 From: odorsey Date: Thu, 10 Oct 2013 19:42:09 -0400 Subject: [PATCH 68/89] Delete 2013-10-10-turtlehack.md --- _posts/odorsey/2013-10-10-turtlehack.md | 27 ------------------------- 1 file changed, 27 deletions(-) delete mode 100644 _posts/odorsey/2013-10-10-turtlehack.md diff --git a/_posts/odorsey/2013-10-10-turtlehack.md b/_posts/odorsey/2013-10-10-turtlehack.md deleted file mode 100644 index 2f88ab3..0000000 --- a/_posts/odorsey/2013-10-10-turtlehack.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -title: Turtle Circle Crazy Party -layout: post -author: odorsey -categories: post ---- -Here's my turtlehack picture! -![Turtlehack Picture](http://img9.imageshack.us/img9/9534/l1ir.jpg "Turtlehack picture") - -And my corresponding code... - -```python -import turtle -import turtlehack -import random - -larry = turtle.Turtle() - -for i in range(random.randint(0,10)): - larry.color(turtlehack.random_color()) - turtlehack.random_circle(larry, 10, 15) - turtlehack.random_location(larry, 125, 125) -larry.color(turtlehack.random_color()) -turtlehack.random_circle(larry, 34, 10) - -turtle.done() -``` From 2cc0ba83782f4abe0b9ed47e0a832f2994a14d06 Mon Sep 17 00:00:00 2001 From: odorsey Date: Thu, 10 Oct 2013 19:42:46 -0400 Subject: [PATCH 69/89] Delete 2013-10-10-turtlehack-post.md --- _posts/odorsey/2013-10-10-turtlehack-post.md | 27 -------------------- 1 file changed, 27 deletions(-) delete mode 100644 _posts/odorsey/2013-10-10-turtlehack-post.md diff --git a/_posts/odorsey/2013-10-10-turtlehack-post.md b/_posts/odorsey/2013-10-10-turtlehack-post.md deleted file mode 100644 index e7cfab0..0000000 --- a/_posts/odorsey/2013-10-10-turtlehack-post.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -title: Turtle Circle Crazy Party -layout: post -author: odorsey -categories: post ---- -Here's my turtlehack picture! -![Turtlehack Picture](http://img9.imageshack.us/img9/9534/l1ir.jpg) - -And my corresponding code... - -```python -import turtle -import turtlehack -import random - -larry = turtle.Turtle() - -for i in range(random.randint(0,10)): - larry.color(turtlehack.random_color()) - turtlehack.random_circle(larry, 10, 15) - turtlehack.random_location(larry, 125, 125) -larry.color(turtlehack.random_color()) -turtlehack.random_circle(larry, 34, 10) - -turtle.done() -``` From f4b3d175b8df6ced56594615e2f1bf25548bce67 Mon Sep 17 00:00:00 2001 From: odorsey Date: Thu, 10 Oct 2013 19:43:17 -0400 Subject: [PATCH 70/89] Create 2013-10-10-turtlehack-post.md --- _posts/odorsey/2013-10-10-turtlehack-post.md | 28 ++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 _posts/odorsey/2013-10-10-turtlehack-post.md diff --git a/_posts/odorsey/2013-10-10-turtlehack-post.md b/_posts/odorsey/2013-10-10-turtlehack-post.md new file mode 100644 index 0000000..92dcc97 --- /dev/null +++ b/_posts/odorsey/2013-10-10-turtlehack-post.md @@ -0,0 +1,28 @@ +--- +title: Turtle Circle Crazy Party +layout: post +author: odorsey +categories: post +--- +Here's my turtlehack picture!
+ +![Turtlehack Picture](http://img9.imageshack.us/img9/9534/l1ir.jpg) + +And my corresponding code... + +```python +import turtle +import turtlehack +import random + +larry = turtle.Turtle() + +for i in range(random.randint(0,10)): + larry.color(turtlehack.random_color()) + turtlehack.random_circle(larry, 10, 15) + turtlehack.random_location(larry, 125, 125) +larry.color(turtlehack.random_color()) +turtlehack.random_circle(larry, 34, 10) + +turtle.done() +``` From 85e458b4340cf71fa2a316fd49eee338c9511c2f Mon Sep 17 00:00:00 2001 From: landongrindheim Date: Thu, 10 Oct 2013 20:37:00 -0400 Subject: [PATCH 71/89] Made my danzig.py post --- _posts/landon/2013-10-10-danzig-the-turtle.md | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 _posts/landon/2013-10-10-danzig-the-turtle.md diff --git a/_posts/landon/2013-10-10-danzig-the-turtle.md b/_posts/landon/2013-10-10-danzig-the-turtle.md new file mode 100644 index 0000000..1ec3bed --- /dev/null +++ b/_posts/landon/2013-10-10-danzig-the-turtle.md @@ -0,0 +1,34 @@ +--- +layout: post +author: lgrindheim +categories: posts +--- + +I made a drawing with a some of the functions that were developed in our turtlehack project. Pretty fun. + +Here's the code: + +``` +import turtle +from turtlehack import * +import random + +danzig= turtle.Turtle() + +#following elliot's example and speeding things up +danzig.speed(15) + +#this is mostly an experiment +for i in range(random.randint(0, 150)): + danzig.write("GLENN") + danzig.color(random_color()) + danzig.pendown() + random_location(danzig, 300, 300) + danzig.circle(random.randint(5,105)) + +turtle.done() + + +``` + +![danzig](http://landonandjana.files.wordpress.com/2013/09/screen-shot-2013-10-10-at-8-17-21-pm.png?w=300&h=189) From 416e0fee36939b12cd59cbedcee6411c9501bec8 Mon Sep 17 00:00:00 2001 From: kylerthecreator Date: Thu, 10 Oct 2013 21:22:57 -0400 Subject: [PATCH 72/89] Post for turtlehack assignment. --- _posts/2013-10-10-turtlehack-assignment.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 _posts/2013-10-10-turtlehack-assignment.md diff --git a/_posts/2013-10-10-turtlehack-assignment.md b/_posts/2013-10-10-turtlehack-assignment.md new file mode 100644 index 0000000..251c4c4 --- /dev/null +++ b/_posts/2013-10-10-turtlehack-assignment.md @@ -0,0 +1,20 @@ +--- + +author: kshaffer +categories: post +--- + +Here's the graphic: ![](http://i.imgur.com/C3ofI79.png) + +And here's the code: + +```python +import turtle +from turtlehack import * + +samo = turtle.Turtle() + +for i in range(0, 10): + random_location = (samo, i, i) + n_sided_polygon(samo, 6, color = random_color(), line_thickness = 5, line_length = 80) +``` From 11de64f3463d12ac6efe168a9e7e09d138d412e1 Mon Sep 17 00:00:00 2001 From: kylerthecreator Date: Thu, 10 Oct 2013 21:29:27 -0400 Subject: [PATCH 73/89] Update 2013-10-10-turtlehack-assignment.md Edited formatting. --- _posts/2013-10-10-turtlehack-assignment.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/_posts/2013-10-10-turtlehack-assignment.md b/_posts/2013-10-10-turtlehack-assignment.md index 251c4c4..0b2124e 100644 --- a/_posts/2013-10-10-turtlehack-assignment.md +++ b/_posts/2013-10-10-turtlehack-assignment.md @@ -1,10 +1,12 @@ --- - +layout: post author: kshaffer categories: post --- -Here's the graphic: ![](http://i.imgur.com/C3ofI79.png) +Here's the graphic: + +![](http://i.imgur.com/C3ofI79.png) And here's the code: From 049070bf52df3beb73a43c7b0959ddb61f3b97cd Mon Sep 17 00:00:00 2001 From: eipeele Date: Thu, 10 Oct 2013 21:33:49 -0400 Subject: [PATCH 74/89] Create 2013-10-10-Polygon_City.md --- _posts/epeele/2013-10-10-Polygon_City.md | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 _posts/epeele/2013-10-10-Polygon_City.md diff --git a/_posts/epeele/2013-10-10-Polygon_City.md b/_posts/epeele/2013-10-10-Polygon_City.md new file mode 100644 index 0000000..f4c9087 --- /dev/null +++ b/_posts/epeele/2013-10-10-Polygon_City.md @@ -0,0 +1,8 @@ +--- +title: Elizabeth's Input Post +layout: post +author: epeele +categories: post +--- + +It's not a Kandinsky, but it's pretty. From 682dbd11e3c3af449cd78052c7cacf01ab4a131e Mon Sep 17 00:00:00 2001 From: eipeele Date: Thu, 10 Oct 2013 21:38:21 -0400 Subject: [PATCH 75/89] Update and rename 2013-10-10-Polygon_City.md to 2013-10-10-Polygon-City.md add code --- _posts/epeele/2013-10-10-Polygon-City.md | 48 ++++++++++++++++++++++++ _posts/epeele/2013-10-10-Polygon_City.md | 8 ---- 2 files changed, 48 insertions(+), 8 deletions(-) create mode 100644 _posts/epeele/2013-10-10-Polygon-City.md delete mode 100644 _posts/epeele/2013-10-10-Polygon_City.md diff --git a/_posts/epeele/2013-10-10-Polygon-City.md b/_posts/epeele/2013-10-10-Polygon-City.md new file mode 100644 index 0000000..9bf34e0 --- /dev/null +++ b/_posts/epeele/2013-10-10-Polygon-City.md @@ -0,0 +1,48 @@ +--- +title: Elizabeth's Input Post +layout: post +author: epeele +categories: post +--- + +It's not a Kandinsky, but it's pretty. + +```python + +>>> import turtle +>>> from turtlehack import * +>>> import random +>>> +>>> harry = turtle.Turtle() +>>> +>>> #speeds us up, courtesy of Elliott Hauser +... harry.speed(20) +>>> +>>> #random circles +... for i in range(random.randint(0, 30)): +... random_location(harry, 450, 500) +... harry.color(random_color()) +... random_circle(harry, 10, 30) +... +>>> #back to another point +... for i in range(random.randint(0, 10)): +... random_location(harry, 200, 150) +... n_sided_polygon(harry, 6, color="#FF00FF", line_thickness=3, line_length=65) +... +0 +0 +0 +>>> #back again to another point +... for i in range(random.randint(0, 5)): +... random_location(harry, 150, 200) +... n_sided_polygon(harry, 8, color="#FFFF00", line_thickness=5, line_length=50) +... +0 +0 +0 +0 +0 +>>> turtle.done() + +``` + diff --git a/_posts/epeele/2013-10-10-Polygon_City.md b/_posts/epeele/2013-10-10-Polygon_City.md deleted file mode 100644 index f4c9087..0000000 --- a/_posts/epeele/2013-10-10-Polygon_City.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -title: Elizabeth's Input Post -layout: post -author: epeele -categories: post ---- - -It's not a Kandinsky, but it's pretty. From 70acfd26dbc5bef7a6a338563c01bfa7e2985ffd Mon Sep 17 00:00:00 2001 From: eipeele Date: Thu, 10 Oct 2013 21:41:22 -0400 Subject: [PATCH 76/89] Update 2013-10-10-Polygon-City.md added screenshot --- _posts/epeele/2013-10-10-Polygon-City.md | 1 + 1 file changed, 1 insertion(+) diff --git a/_posts/epeele/2013-10-10-Polygon-City.md b/_posts/epeele/2013-10-10-Polygon-City.md index 9bf34e0..a812b6d 100644 --- a/_posts/epeele/2013-10-10-Polygon-City.md +++ b/_posts/epeele/2013-10-10-Polygon-City.md @@ -46,3 +46,4 @@ It's not a Kandinsky, but it's pretty. ``` +![Turtlehack](http://www.unc.edu/~epeele/file/peele_turtlehack.png) From 293a08b203f24b96da2eb4c7c5f8af21b1651cd1 Mon Sep 17 00:00:00 2001 From: eipeele Date: Thu, 10 Oct 2013 21:42:35 -0400 Subject: [PATCH 77/89] Update 2013-10-10-Polygon-City.md changed name --- _posts/epeele/2013-10-10-Polygon-City.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_posts/epeele/2013-10-10-Polygon-City.md b/_posts/epeele/2013-10-10-Polygon-City.md index a812b6d..ecf793d 100644 --- a/_posts/epeele/2013-10-10-Polygon-City.md +++ b/_posts/epeele/2013-10-10-Polygon-City.md @@ -1,5 +1,5 @@ --- -title: Elizabeth's Input Post +title: Elizabeth's Turtlehack layout: post author: epeele categories: post From a362a76ad0aa75ed7287aa117ce2443bd6165f66 Mon Sep 17 00:00:00 2001 From: eipeele Date: Thu, 10 Oct 2013 21:44:27 -0400 Subject: [PATCH 78/89] Update 2013-10-10-Polygon-City.md changed name --- _posts/epeele/2013-10-10-Polygon-City.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_posts/epeele/2013-10-10-Polygon-City.md b/_posts/epeele/2013-10-10-Polygon-City.md index ecf793d..006484e 100644 --- a/_posts/epeele/2013-10-10-Polygon-City.md +++ b/_posts/epeele/2013-10-10-Polygon-City.md @@ -1,5 +1,5 @@ --- -title: Elizabeth's Turtlehack +title: Elizabeth's Turtlehack Post layout: post author: epeele categories: post From e6daacee2fb5f9afd613fb8e973c864e7cc13b0a Mon Sep 17 00:00:00 2001 From: ashmbrown Date: Thu, 10 Oct 2013 23:33:13 -0400 Subject: [PATCH 79/89] Ashley's turtlehack post needs to be merged --- .../2010-10-10-Turtle-Hack-Fractals.md | 62 +++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 _posts/ashmbrown/2010-10-10-Turtle-Hack-Fractals.md diff --git a/_posts/ashmbrown/2010-10-10-Turtle-Hack-Fractals.md b/_posts/ashmbrown/2010-10-10-Turtle-Hack-Fractals.md new file mode 100644 index 0000000..a9ec9b9 --- /dev/null +++ b/_posts/ashmbrown/2010-10-10-Turtle-Hack-Fractals.md @@ -0,0 +1,62 @@ +--- +title: Turtle Hack - Fractal +layout: post +author: abrown +categories: post +--- + +Greetings all, + +So I am reading a book for a class called 'Leadership and New Science' by Margaret Wheatley. The book argues that organizations should take some of their leadership and management principles from new science theories, especially in quantum physics (focusing on chaos and order). The amazon review is located [here](http://www.amazon.com/Leadership-New-Science-Learning-Organization/dp/1881052443). + +Anyway, one of the concepts Wheatley discusses is fractals. Fractals form patterns because they are self-similar. In geometry, two figures are “similar” if they have the exact same shape. So all squares are similar to each other, but not all rectangles have to be similar (shape can differ; think a wide rectangle versus a tall rectangle). And we’re talking about the shape, not the size. Since fractals are self-similar that means they essentially create copies of the same shape; and these shapes are repeated over and over again to create patterns. Wheatley wrote about how fractals could be represented in simple computer programs. So, I set out to see if I could create a fractal with our turtle hack. + +To create a fractal, I first added a function to my local copy of the turtlehack.py by using nano. I borrowed code from the Open Book Project, which you can find [here](http://openbookproject.net/thinkcs/python/english3e/recursion.html). + +So, I then tried to run the function in a second terminal. My turtle (I named him Jack) started to spin but he did not move. He looked like he was getting very dizzy. I knew I had to get him moving, so off to google I went. I figured out that I had to move his position. I also discussed this with a friend of mine who is a programmer. He walked me through some of the thought processes. I used the setpos, up, and down commands to set his position and then have him move based on the fractal function written early. I'm going to be honest here, this took a while and a lot of googling, and I think I only understand some of it. Having it to talk through with someone has been helpful, as well. + +So without further to do, here are my screen shots, and my code: + +![The function I put into turtlehack.py](https://lh5.googleusercontent.com/-v2YngV27q_0/Uldn8QUzaMI/AAAAAAAAAKw/G9unoV9FPvw/w880-h495-no/turtle_hack_fractal.jpg) +![The python code to execute Jack, the turtle](https://lh4.googleusercontent.com/-BS-fD1H6BNQ/Uldn8b2AOhI/AAAAAAAAAK0/6YrZceEkNxI/w880-h495-no/turtle_hack_fractal_2.jpg) + +So don't let the neatness of the second screenshot fool you, I messed that up a lot. I just kept closing the terminal and starting fresh because I got frustrated seeing the error messages over and over again. + +Here is the code for the function: + +```python + +def koch(turtle, order, size): + if order == 0: + turtle.forward(size) + else: + for angle in [60, -120, 60, 0]: + koch(turtle, order-1, size/3) + turtle.left(angle) + +``` + +Here is the code to execute the function: + + +```python + +import turtle +from turtlehack import * +import random + +jack= turtle.Turtle() + jack.speed(5) + jack.up() + jack.setpos(-200, 0) + jack.down() + koch(jack, 3, 500) + +``` + +So, I guess the next step would be to merge my function in my local copy of turtlehack into the master copy. However, I am still confused about out to use the command line to do this. Does anyone have any good notes on this? + +Thanks! + +Ashley + From c881bb3d340fa5e0f1631a36116021269624c8f5 Mon Sep 17 00:00:00 2001 From: ashmbrown Date: Thu, 10 Oct 2013 23:34:39 -0400 Subject: [PATCH 80/89] Made a grammar edit to Ashley's turtlehack post --- _posts/ashmbrown/2010-10-10-Turtle-Hack-Fractals.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_posts/ashmbrown/2010-10-10-Turtle-Hack-Fractals.md b/_posts/ashmbrown/2010-10-10-Turtle-Hack-Fractals.md index a9ec9b9..b17c3eb 100644 --- a/_posts/ashmbrown/2010-10-10-Turtle-Hack-Fractals.md +++ b/_posts/ashmbrown/2010-10-10-Turtle-Hack-Fractals.md @@ -15,7 +15,7 @@ To create a fractal, I first added a function to my local copy of the turtlehack So, I then tried to run the function in a second terminal. My turtle (I named him Jack) started to spin but he did not move. He looked like he was getting very dizzy. I knew I had to get him moving, so off to google I went. I figured out that I had to move his position. I also discussed this with a friend of mine who is a programmer. He walked me through some of the thought processes. I used the setpos, up, and down commands to set his position and then have him move based on the fractal function written early. I'm going to be honest here, this took a while and a lot of googling, and I think I only understand some of it. Having it to talk through with someone has been helpful, as well. -So without further to do, here are my screen shots, and my code: +So without further ado, here are my screen shots, and my code: ![The function I put into turtlehack.py](https://lh5.googleusercontent.com/-v2YngV27q_0/Uldn8QUzaMI/AAAAAAAAAKw/G9unoV9FPvw/w880-h495-no/turtle_hack_fractal.jpg) ![The python code to execute Jack, the turtle](https://lh4.googleusercontent.com/-BS-fD1H6BNQ/Uldn8b2AOhI/AAAAAAAAAK0/6YrZceEkNxI/w880-h495-no/turtle_hack_fractal_2.jpg) From 396dea2434e3def697a542bf34b54efba67629c9 Mon Sep 17 00:00:00 2001 From: allhailaugustus Date: Thu, 10 Oct 2013 23:56:41 -0400 Subject: [PATCH 81/89] Create Stacey's second turtle post --- .../2013-10-10-staceys-second-turtle.md | 59 +++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 _posts/stacey/2013-10-10-staceys-second-turtle.md diff --git a/_posts/stacey/2013-10-10-staceys-second-turtle.md b/_posts/stacey/2013-10-10-staceys-second-turtle.md new file mode 100644 index 0000000..632bed2 --- /dev/null +++ b/_posts/stacey/2013-10-10-staceys-second-turtle.md @@ -0,0 +1,59 @@ +--- +title: I wonder how often April O'Neil washed that yellow jumpsuit. +layout: post +author: smantooth +categories: post +--- + +My turtles look like they grew some really narwly fungus. + + +BOOM! + +![Pisanello, the oft forgotten fifth ninja turtle approves this python turtle image.](http://imageshack.us/a/img854/1432/gtjw.png) + + + +And just for funzies, I did one with squares too. + +![CIRCLES AND SQUARES. CIRCLES AND SQUARES.](http://imageshack.us/a/img820/729/44ms.png) + + + +```python + +import turtle +from turtlehack import * +import random + +bobbert = turtle.Turtle() +dukes = turtle.Screen() + +turtle.hideturtle() + +for i in range(random.randint(40, 90)): + + turtle.left(random.randint(1, 360)) + turtle.penup() + turtle.forward(random.randint(25, 300)) + turtle.pendown() + turtle.dot(random.randint(10, 125), random_color()) + colored_square(bobbert, random.randint(10, 300), random_color()) # leave this line out if you don't want the squares + turtle.penup() + turtle.home() + dukes.bgcolor(random_color()) # change this to a single color if strobe lights give you seizures + + +turtle.done() + +``` + + + +I originally wanted to make a function that produced random pokadots (or something that looked vaguely like chickenpox) and tried to use the random location function in turtlehack. +That did not work at all. It just drew a bunch of dots in the center of the page while the turtle zoomed off to draw some random lines. Also, +anyone know any good ways to keep the drawings on the canvas? It took me an embarssingly long time to realize that sending the loop back to the +center everytime would help keep my dots from wandering off, but it also means they clump toward the middle. + +Dots! + From 3048b9481778dedf0ed7270c7b928981e9708e1d Mon Sep 17 00:00:00 2001 From: allhailaugustus Date: Fri, 11 Oct 2013 00:02:18 -0400 Subject: [PATCH 82/89] Who's got two thumbs and uses Google for spell check. This kid right chere. --- _posts/stacey/2013-10-10-staceys-second-turtle.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/_posts/stacey/2013-10-10-staceys-second-turtle.md b/_posts/stacey/2013-10-10-staceys-second-turtle.md index 632bed2..6213ec1 100644 --- a/_posts/stacey/2013-10-10-staceys-second-turtle.md +++ b/_posts/stacey/2013-10-10-staceys-second-turtle.md @@ -1,11 +1,11 @@ --- -title: I wonder how often April O'Neil washed that yellow jumpsuit. +title: I wonder how often April O'Neil washed that yellow jumpsuit layout: post author: smantooth categories: post --- -My turtles look like they grew some really narwly fungus. +My turtles look like they grew some really gnarly fungus. BOOM! @@ -14,8 +14,11 @@ BOOM! + And just for funzies, I did one with squares too. + + ![CIRCLES AND SQUARES. CIRCLES AND SQUARES.](http://imageshack.us/a/img820/729/44ms.png) @@ -50,6 +53,8 @@ turtle.done() + + I originally wanted to make a function that produced random pokadots (or something that looked vaguely like chickenpox) and tried to use the random location function in turtlehack. That did not work at all. It just drew a bunch of dots in the center of the page while the turtle zoomed off to draw some random lines. Also, anyone know any good ways to keep the drawings on the canvas? It took me an embarssingly long time to realize that sending the loop back to the From 26da5f3780fa1ecffcef940d6e972435ad454876 Mon Sep 17 00:00:00 2001 From: allhailaugustus Date: Fri, 11 Oct 2013 00:03:59 -0400 Subject: [PATCH 83/89] More spelling. minor text edits --- _posts/stacey/2013-10-10-staceys-second-turtle.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_posts/stacey/2013-10-10-staceys-second-turtle.md b/_posts/stacey/2013-10-10-staceys-second-turtle.md index 6213ec1..92b9f1f 100644 --- a/_posts/stacey/2013-10-10-staceys-second-turtle.md +++ b/_posts/stacey/2013-10-10-staceys-second-turtle.md @@ -55,7 +55,7 @@ turtle.done() -I originally wanted to make a function that produced random pokadots (or something that looked vaguely like chickenpox) and tried to use the random location function in turtlehack. +I originally wanted to make a function that produced random polka dots (or something that looked vaguely like chickenpox) and tried to use the random location function in turtlehack. That did not work at all. It just drew a bunch of dots in the center of the page while the turtle zoomed off to draw some random lines. Also, anyone know any good ways to keep the drawings on the canvas? It took me an embarssingly long time to realize that sending the loop back to the center everytime would help keep my dots from wandering off, but it also means they clump toward the middle. From eb46600e5f3f872bdcbbd023ec89c0e52aed8e5c Mon Sep 17 00:00:00 2001 From: Caroline Pate Date: Fri, 11 Oct 2013 13:35:49 -0400 Subject: [PATCH 84/89] Create 2013-10-11-Caroline's-Turtlehack.md --- _posts/2013-10-11-Caroline's-Turtlehack.md | 29 ++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 _posts/2013-10-11-Caroline's-Turtlehack.md diff --git a/_posts/2013-10-11-Caroline's-Turtlehack.md b/_posts/2013-10-11-Caroline's-Turtlehack.md new file mode 100644 index 0000000..ffa2bfe --- /dev/null +++ b/_posts/2013-10-11-Caroline's-Turtlehack.md @@ -0,0 +1,29 @@ +--- +layout: post +author: carolinp +categories: post +--- + +![my python turtlehack drawing](https://lh3.googleusercontent.com/--wt2U_IdVP4/Ulg1miqTcjI/AAAAAAAAAMk/e094NHv7i-U/w737-h553-no/python_turtlehack.png) + +```python + +import turtle +import random +from turtlehack import * +lisa = turtle.Turtle() + +size = 50 +for i in range(10): + colored_square(lisa, size, random_color()) + size += 10 + +for i in range(3): + lisa.forward(75) + lisa.left(120) + lisa.color(random_color()) + random_circle(lisa, 5, 10) + + +``` + From ae1b34e6258d112d6292ebd606ff833e4b4b340f Mon Sep 17 00:00:00 2001 From: ashmbrown Date: Fri, 11 Oct 2013 14:13:02 -0400 Subject: [PATCH 85/89] Fixed the Date in the file name --- ...Turtle-Hack-Fractals.md => 2013-10-10-Turtle-Hack-Fractals.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename _posts/ashmbrown/{2010-10-10-Turtle-Hack-Fractals.md => 2013-10-10-Turtle-Hack-Fractals.md} (100%) diff --git a/_posts/ashmbrown/2010-10-10-Turtle-Hack-Fractals.md b/_posts/ashmbrown/2013-10-10-Turtle-Hack-Fractals.md similarity index 100% rename from _posts/ashmbrown/2010-10-10-Turtle-Hack-Fractals.md rename to _posts/ashmbrown/2013-10-10-Turtle-Hack-Fractals.md From c9536bad2dbfae6b4abdae7da2c364b0b64f04a0 Mon Sep 17 00:00:00 2001 From: alexharding Date: Fri, 11 Oct 2013 15:54:44 -0400 Subject: [PATCH 86/89] Create 2013-10-11-alex's-turtle-triangles.md my turtle post --- .../2013-10-11-alex's-turtle-triangles.md | 59 +++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 _posts/alexharding/2013-10-11-alex's-turtle-triangles.md diff --git a/_posts/alexharding/2013-10-11-alex's-turtle-triangles.md b/_posts/alexharding/2013-10-11-alex's-turtle-triangles.md new file mode 100644 index 0000000..06ac5db --- /dev/null +++ b/_posts/alexharding/2013-10-11-alex's-turtle-triangles.md @@ -0,0 +1,59 @@ +--- +layout: post +author: alexharding +published: true +--- + +# Right triangles! + +I decided to try and make a function that builds regular right triangles. Everone's familiar with the grade-school idea of the pythagorean theorem, with a^2 + b^2 = c^2. +So I wrote a function that takes three inputs... a width, a height and a direction. The width and height make up the right angle of the triangle, and the function creates the hypotenuse. +The direction input decides which direction it draws in, or which side the right angle will face. + +Instead of making this only work with standard triangles (45/45/90 or 30/60/90), I brushed up on geometry and trig a little to make it work for any two lengths. The function requires some math importing to get this to work. + +At the end of each triangle, the turtle gets reset to the home position. + +There're other things that could be added to this for fun... right now it only draws right and left, making it able to flip up or down would be cool. Or add a fill component so it fills a color too. Lots of fun to be had! +#Function + +``` +import turtle + +from math import sqrt, asin, pi + +def right_triangle(height,width,direction): +# takes direction to mean which side of the triangle will have the hypoteneuse + + +# using pythagorean theorem: hyp is the sqrt of height^2 + width^2 + hypotenuse=sqrt((height**2)+(width**2)) + +# using radians for sin functions + turtle.radians() + + if direction == 'right': + turtle.forward(width) + #90 degrees in radians + turtle.setheading(1.57079633) + turtle.forward(height) + #pi is 180 degrees in radians, arcsin of side over hypotenuse equals angle + turtle.setheading(pi+asin(height/hypotenuse)) + turtle.forward(hypotenuse) + turtle.home() + + if direction =='left': + turtle.setheading(pi) + turtle.forward(width) + #90 degrees in radians + turtle.setheading(1.57079633) + turtle.forward(height) + #arcsin of side over hypotenuse equals angle, subtracted + turtle.setheading(-asin(height/hypotenuse)) + turtle.forward(hypotenuse) + turtle.home() +``` + + +#Screenshot +![]http://i.imgur.com/v3bk98n.png From 4fe3eb061e66a04c91b1ad49048962ae56da08f4 Mon Sep 17 00:00:00 2001 From: alexharding Date: Fri, 11 Oct 2013 15:55:41 -0400 Subject: [PATCH 87/89] fixing screenshot --- _posts/alexharding/2013-10-11-alex's-turtle-triangles.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_posts/alexharding/2013-10-11-alex's-turtle-triangles.md b/_posts/alexharding/2013-10-11-alex's-turtle-triangles.md index 06ac5db..2cedb20 100644 --- a/_posts/alexharding/2013-10-11-alex's-turtle-triangles.md +++ b/_posts/alexharding/2013-10-11-alex's-turtle-triangles.md @@ -56,4 +56,4 @@ def right_triangle(height,width,direction): #Screenshot -![]http://i.imgur.com/v3bk98n.png +![](http://i.imgur.com/v3bk98n.png) From 302754ede77831b76336be8bd30109ef5bc548dd Mon Sep 17 00:00:00 2001 From: Grant McLendon Date: Fri, 11 Oct 2013 15:56:04 -0400 Subject: [PATCH 88/89] Create 2013-10-11-grants-turtle2.md --- _posts/gerbal/2013-10-11-grants-turtle2.md | 53 ++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 _posts/gerbal/2013-10-11-grants-turtle2.md diff --git a/_posts/gerbal/2013-10-11-grants-turtle2.md b/_posts/gerbal/2013-10-11-grants-turtle2.md new file mode 100644 index 0000000..9387d54 --- /dev/null +++ b/_posts/gerbal/2013-10-11-grants-turtle2.md @@ -0,0 +1,53 @@ +--- +title: Grant's Turtle Drawing 2 +layout: post +author: gmclendon +categories: post +--- + + +Sadly without any cool ninja turtle references: +![turtledrawing2](http://i.imgur.com/F1CxqiK.png) + +and the code: + +```python +import turtle +import turtlehack +from random import randint + +bob = turtle.Turtle() +bob.ht() +bob.speed(0) + +def bobfill(turtle): + if randint(0,2) == 0: + turtle.fill(True) +for i in range(randint(20,50)): + bob.pendown() + n = randint(0,3) + if n == 0: + bobfill(bob) + turtlehack.colored_circle(bob,randint(0,50), turtlehack.random_color()) + bob.fill(False) + if n == 1: + bobfill(bob) + turtlehack.colored_square(bob,randint(0,50), turtlehack.random_color()) + bob.fill(False) + if n == 2: + bobfill(bob) + turtlehack.random_circle(bob, randint(1,10)) + bob.fill(False) + if n == 3: + bobfill(bob) + turtlehack.n_sided_polygon(bob, randint(1,10),turtlehack.random_color(), randint(1,20), randint(5,120)) + bob.fill(False) + if randint(0,2) == 1: + bob.right(randint(0,360)) + turtlehack.dotted_line(bob, randint(5,40), randint(1,10), turtlehack.random_color()) + if (randint(0,90)%3)!=0: + bob.penup() + turtlehack.random_location(bob, 200,200) +print "done" +turtle.done() +``` From fea0d58c2c40dc0eb34142cda84b83915634c5ec Mon Sep 17 00:00:00 2001 From: zekuny Date: Fri, 11 Oct 2013 16:19:27 -0400 Subject: [PATCH 89/89] Create first turtlehack assignment --- _posts/2013-10-11-turtlehack-assignment.md | 35 ++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 _posts/2013-10-11-turtlehack-assignment.md diff --git a/_posts/2013-10-11-turtlehack-assignment.md b/_posts/2013-10-11-turtlehack-assignment.md new file mode 100644 index 0000000..cfd3d37 --- /dev/null +++ b/_posts/2013-10-11-turtlehack-assignment.md @@ -0,0 +1,35 @@ +--- +title: assignment +layout: post +author: zekuny +categories: post +--- + +Codes: + +```python + +import turtle +from turtlehack import * +import random + +focus=turtle.Turtle() + +for i in range(random.randint(0,10)): + random_location(focus, 300, 300) + focus.color(random_color()) + random_circle(focus, 5, 15) + +for i in range(random.randint(0,5)): + colored_square(focus, 50, random_color()) + +random_location(focus,300,300) + +for i in range(random.randint(0,8)): + n_sided_polygon(focus,8,color=random_color(),line_thickness=3,line_length=80) + +for i in range(random.randint(0,12)): + n_sided_polygon(focus,8,color=random_color(),line_thickness=3,line_length=80) +``` + +![Image](https://pbs.twimg.com/media/BWUlsfOCcAAO4zi.jpg)