<?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 on: Example 13-2: Random Number Distribution</title>
	<atom:link href="http://www.learningprocessing.com/examples/chapter-13/example-13-2-random-number-distribution/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.learningprocessing.com</link>
	<description>A Beginner's Guide to Programming Images, Animation, and Interaction by Daniel Shiffman</description>
	<lastBuildDate>Fri, 10 Feb 2012 19:58:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Daniel Shiffman</title>
		<link>http://www.learningprocessing.com/examples/chapter-13/example-13-2-random-number-distribution/comment-page-1/#comment-9873</link>
		<dc:creator>Daniel Shiffman</dc:creator>
		<pubDate>Thu, 11 Mar 2010 17:16:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningprocessing.com/?page_id=522#comment-9873</guid>
		<description>1.  Yes, technically speaking, it would be better for me to have written:

&lt;pre&gt;
  for (int i = 0; i &lt; randomCounts.length; i++ ) {
    randomCounts[i] = 0;
  }
&lt;/pre&gt;

It&#039;s always a good idea to initialize.  Since the default value for a float is 0, the code works without it anyway.

2.  I&#039;m not seeing this.  When I add:

&lt;pre&gt;
  println(randomCounts[0]);
&lt;/pre&gt;

to the end of draw(), the output I see is 0.0, 1.0, 2.0, etc.</description>
		<content:encoded><![CDATA[<p>1.  Yes, technically speaking, it would be better for me to have written:</p>
<pre>
  for (int i = 0; i < randomCounts.length; i++ ) {
    randomCounts[i] = 0;
  }
</pre>
<p>It's always a good idea to initialize.  Since the default value for a float is 0, the code works without it anyway.</p>
<p>2.  I'm not seeing this.  When I add:</p>
</pre>
<pre>
  println(randomCounts[0]);
</pre>
<p>to the end of draw(), the output I see is 0.0, 1.0, 2.0, etc.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: P3HO</title>
		<link>http://www.learningprocessing.com/examples/chapter-13/example-13-2-random-number-distribution/comment-page-1/#comment-9840</link>
		<dc:creator>P3HO</dc:creator>
		<pubDate>Wed, 10 Mar 2010 19:08:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningprocessing.com/?page_id=522#comment-9840</guid>
		<description>1. 
In this example, where is the part of initializing an array &quot;radomCounts&quot;?
I think there is no initializing and randomCounts[0] ~ randomCounts[19]  have same default value &quot;0.00&quot;... right? (I&#039;m confusing about array&#039;s data have default value when there&#039;s no initializing start values of array&#039;s data.)

2.
I tried to &quot; print(randomCounts[0]); &quot;, and the value of randomCounts[0] increased by 0.01, not by 1 that the value I expected..
I guess, according to &quot; randomCounts[ index ] ++; &quot;, the value of randomCounts[0] increase by 1.
I changed &quot; randomCounts[index]++ &quot; to  &quot; randomCounts[index] += 3; &quot;, and  the value of randomCounts[0] increased by 0.03, not by 3 that I expected... Explain me, please...;-)</description>
		<content:encoded><![CDATA[<p>1.<br />
In this example, where is the part of initializing an array &#8220;radomCounts&#8221;?<br />
I think there is no initializing and randomCounts[0] ~ randomCounts[19]  have same default value &#8220;0.00&#8243;&#8230; right? (I&#8217;m confusing about array&#8217;s data have default value when there&#8217;s no initializing start values of array&#8217;s data.)</p>
<p>2.<br />
I tried to &#8221; print(randomCounts[0]); &#8220;, and the value of randomCounts[0] increased by 0.01, not by 1 that the value I expected..<br />
I guess, according to &#8221; randomCounts[ index ] ++; &#8220;, the value of randomCounts[0] increase by 1.<br />
I changed &#8221; randomCounts[index]++ &#8221; to  &#8221; randomCounts[index] += 3; &#8220;, and  the value of randomCounts[0] increased by 0.03, not by 3 that I expected&#8230; Explain me, please&#8230;;-)</p>
]]></content:encoded>
	</item>
</channel>
</rss>

