<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments for Jon Garvin</title>
	<atom:link href="http://jongarvin.com/comments/feed/" rel="self" type="application/rss+xml" />
	<link>http://jongarvin.com</link>
	<description>Mathematics and Computer Science Teacher</description>
	<lastBuildDate>Wed, 25 Jan 2012 19:08:47 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>Comment on Code Repetition by Jon</title>
		<link>http://jongarvin.com/tutorials/python-3-tutorial/python3-code-repetition/#comment-138</link>
		<dc:creator>Jon</dc:creator>
		<pubDate>Wed, 25 Jan 2012 19:08:47 +0000</pubDate>
		<guid isPermaLink="false">http://jongarvin.com/?page_id=31#comment-138</guid>
		<description>Since you (presumably) know the randomly-generated number beforehand, a for loop would be a better choice. Using a &quot;start&quot; value of 1, and a &quot;stop&quot; value of &lt;em&gt;n&lt;/em&gt;+1 (since Python does not include the &quot;stop&quot; value in its iterations), you can loop through the values 1-&lt;em&gt;n&lt;/em&gt;. Inside of this loop, use another variable to keep a cumulative sum of these values.

Here&#039;s an example that uses &lt;em&gt;n&lt;/em&gt;=10. You can change the code to read a value from the user, or to generate a random value using the random module.
&lt;pre&gt;
n = 10
total = 0
for count in range(1, n+1):
   total += count
print(total)
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>Since you (presumably) know the randomly-generated number beforehand, a for loop would be a better choice. Using a &#8220;start&#8221; value of 1, and a &#8220;stop&#8221; value of <em>n</em>+1 (since Python does not include the &#8220;stop&#8221; value in its iterations), you can loop through the values 1-<em>n</em>. Inside of this loop, use another variable to keep a cumulative sum of these values.</p>
<p>Here&#8217;s an example that uses <em>n</em>=10. You can change the code to read a value from the user, or to generate a random value using the random module.</p>
<pre>
n = 10
total = 0
for count in range(1, n+1):
   total += count
print(total)
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Code Repetition by C</title>
		<link>http://jongarvin.com/tutorials/python-3-tutorial/python3-code-repetition/#comment-137</link>
		<dc:creator>C</dc:creator>
		<pubDate>Tue, 24 Jan 2012 10:33:00 +0000</pubDate>
		<guid isPermaLink="false">http://jongarvin.com/?page_id=31#comment-137</guid>
		<description>how would you create a program that will determine the sum of the numbers from 1 up to a randomly generated number?</description>
		<content:encoded><![CDATA[<p>how would you create a program that will determine the sum of the numbers from 1 up to a randomly generated number?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Tuples and Lists by Jon</title>
		<link>http://jongarvin.com/tutorials/python-3-tutorial/python3-lists/#comment-125</link>
		<dc:creator>Jon</dc:creator>
		<pubDate>Thu, 05 Jan 2012 23:51:28 +0000</pubDate>
		<guid isPermaLink="false">http://jongarvin.com/?page_id=204#comment-125</guid>
		<description>1. Your 14 variables contained in the list are redundant, and defeat the real benefit of using lists. Eliminate them completely, as discussed earlier.
2. Ensure that in your drawBoard function that you are actually printing the updated values, and not a) local variables with the same names, or b) completely different variables.</description>
		<content:encoded><![CDATA[<p>1. Your 14 variables contained in the list are redundant, and defeat the real benefit of using lists. Eliminate them completely, as discussed earlier.<br />
2. Ensure that in your drawBoard function that you are actually printing the updated values, and not a) local variables with the same names, or b) completely different variables.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Tuples and Lists by N</title>
		<link>http://jongarvin.com/tutorials/python-3-tutorial/python3-lists/#comment-124</link>
		<dc:creator>N</dc:creator>
		<pubDate>Thu, 05 Jan 2012 17:12:42 +0000</pubDate>
		<guid isPermaLink="false">http://jongarvin.com/?page_id=204#comment-124</guid>
		<description>My program is allowing me to sow seeds however, it won&#039;t update to the board. I printed out each house as a tuple, and it updates there but not on the drawBoard function itself. I have made a list containg all my houses as follows:
 L=[H1,H2,H3,H4,H5,H6,SK,H7,H8,H9,H10,H11,H12,NK]
but it just won&#039;t update.
Any suggestions?</description>
		<content:encoded><![CDATA[<p>My program is allowing me to sow seeds however, it won&#8217;t update to the board. I printed out each house as a tuple, and it updates there but not on the drawBoard function itself. I have made a list containg all my houses as follows:<br />
 L=[H1,H2,H3,H4,H5,H6,SK,H7,H8,H9,H10,H11,H12,NK]<br />
but it just won&#8217;t update.<br />
Any suggestions?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Tuples and Lists by Jon</title>
		<link>http://jongarvin.com/tutorials/python-3-tutorial/python3-lists/#comment-123</link>
		<dc:creator>Jon</dc:creator>
		<pubDate>Sun, 01 Jan 2012 02:01:07 +0000</pubDate>
		<guid isPermaLink="false">http://jongarvin.com/?page_id=204#comment-123</guid>
		<description>Yes. In this version of Kalah, landing in an empty house on your own side always results in a capture, even if there are no seeds in the opposite house. In this case, the only seed captured is your last seed. Ideally, you should be sowing the seeds, then noting the house in which your last seed falls, and calling canCapture. If True, then proceed appropriately.

Note that in the original game of Kalah, a capture does not result in an additional turn. The version you are programming is even more biased toward the first player.</description>
		<content:encoded><![CDATA[<p>Yes. In this version of Kalah, landing in an empty house on your own side always results in a capture, even if there are no seeds in the opposite house. In this case, the only seed captured is your last seed. Ideally, you should be sowing the seeds, then noting the house in which your last seed falls, and calling canCapture. If True, then proceed appropriately.</p>
<p>Note that in the original game of Kalah, a capture does not result in an additional turn. The version you are programming is even more biased toward the first player.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Tuples and Lists by T</title>
		<link>http://jongarvin.com/tutorials/python-3-tutorial/python3-lists/#comment-122</link>
		<dc:creator>T</dc:creator>
		<pubDate>Fri, 30 Dec 2011 05:22:33 +0000</pubDate>
		<guid isPermaLink="false">http://jongarvin.com/?page_id=204#comment-122</guid>
		<description>re: project kalah
Now I know canCapture function means ... it can capture its own seed, no concern for rival side, and the function returns true. Is that right?</description>
		<content:encoded><![CDATA[<p>re: project kalah<br />
Now I know canCapture function means &#8230; it can capture its own seed, no concern for rival side, and the function returns true. Is that right?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Tuples and Lists by Jon</title>
		<link>http://jongarvin.com/tutorials/python-3-tutorial/python3-lists/#comment-121</link>
		<dc:creator>Jon</dc:creator>
		<pubDate>Thu, 29 Dec 2011 17:46:07 +0000</pubDate>
		<guid isPermaLink="false">http://jongarvin.com/?page_id=204#comment-121</guid>
		<description>To clarify the test, my board uses 1-6 as South&#039;s houses, then 8-13 as North&#039;s. The board looks something like this.

NK 13 12 11 10 09 08
01 02 03 04 05 06 SK

The indices are off-shifted by one. You may need to adjust your tests appropriately. Hope this helps.</description>
		<content:encoded><![CDATA[<p>To clarify the test, my board uses 1-6 as South&#8217;s houses, then 8-13 as North&#8217;s. The board looks something like this.</p>
<p>NK 13 12 11 10 09 08<br />
01 02 03 04 05 06 SK</p>
<p>The indices are off-shifted by one. You may need to adjust your tests appropriately. Hope this helps.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Tuples and Lists by T</title>
		<link>http://jongarvin.com/tutorials/python-3-tutorial/python3-lists/#comment-117</link>
		<dc:creator>T</dc:creator>
		<pubDate>Sun, 25 Dec 2011 18:49:00 +0000</pubDate>
		<guid isPermaLink="false">http://jongarvin.com/?page_id=204#comment-117</guid>
		<description>re: cumulative project: kalah
It works fine with suggestive input until sixth...</description>
		<content:encoded><![CDATA[<p>re: cumulative project: kalah<br />
It works fine with suggestive input until sixth&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Tuples and Lists by Jon</title>
		<link>http://jongarvin.com/tutorials/python-3-tutorial/python3-lists/#comment-61</link>
		<dc:creator>Jon</dc:creator>
		<pubDate>Tue, 06 Dec 2011 02:21:13 +0000</pubDate>
		<guid isPermaLink="false">http://jongarvin.com/?page_id=204#comment-61</guid>
		<description>Printing vertically is a bigger challenge, but not out of the question. First, get your horizontal histogram printing properly. Now, rotate it sideways and look at what you have -- all shorter bars will have empty spaces as padding before the larger bars are printed. You just need to figure out how to work the padding inside of your loop(s).</description>
		<content:encoded><![CDATA[<p>Printing vertically is a bigger challenge, but not out of the question. First, get your horizontal histogram printing properly. Now, rotate it sideways and look at what you have &#8212; all shorter bars will have empty spaces as padding before the larger bars are printed. You just need to figure out how to work the padding inside of your loop(s).</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Tuples and Lists by R</title>
		<link>http://jongarvin.com/tutorials/python-3-tutorial/python3-lists/#comment-60</link>
		<dc:creator>R</dc:creator>
		<pubDate>Mon, 05 Dec 2011 21:41:04 +0000</pubDate>
		<guid isPermaLink="false">http://jongarvin.com/?page_id=204#comment-60</guid>
		<description>Any tips for question I?</description>
		<content:encoded><![CDATA[<p>Any tips for question I?</p>
]]></content:encoded>
	</item>
</channel>
</rss>

