<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[Rails Forum - Ruby on Rails Help and Discussion Forum - Adding elements in a array [IMG]]]></title>
		<link>http://railsforum.com/viewtopic.php?id=44434</link>
		<description><![CDATA[The most recent posts in Adding elements in a array [IMG].]]></description>
		<lastBuildDate>Thu, 07 Jul 2011 15:25:18 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Adding elements in a array [IMG]]]></title>
			<link>http://railsforum.com/viewtopic.php?pid=141977#p141977</link>
			<description><![CDATA[<p>I`ve asked this questions around couple of sites and your answer is the most easy to read and to use I got.</p><p>Thanks for taking the time out of your day and writing a reply!</p><p>This helped alot.</p>]]></description>
			<author><![CDATA[dummy@example.com (Big_Bird)]]></author>
			<pubDate>Thu, 07 Jul 2011 15:25:18 +0000</pubDate>
			<guid>http://railsforum.com/viewtopic.php?pid=141977#p141977</guid>
		</item>
		<item>
			<title><![CDATA[Re: Adding elements in a array [IMG]]]></title>
			<link>http://railsforum.com/viewtopic.php?pid=141532#p141532</link>
			<description><![CDATA[<p>If I properly understand this task, one of the possible solutions looks like this<br /></p><div class="codebox"><pre><code>x = [12, 23, 7, 48, 71, 2]
y = []

x.inject do |s, i|
  y &lt;&lt; s + i
  y.last
end

while true
  numb = gets.chomp.to_i
  if y.detect { |i| i == numb }
    puts &quot;#{numb} has been found!&quot;
    break
  end
end</code></pre></div>]]></description>
			<author><![CDATA[dummy@example.com (WarHog)]]></author>
			<pubDate>Sat, 25 Jun 2011 21:21:26 +0000</pubDate>
			<guid>http://railsforum.com/viewtopic.php?pid=141532#p141532</guid>
		</item>
		<item>
			<title><![CDATA[Adding elements in a array [IMG]]]></title>
			<link>http://railsforum.com/viewtopic.php?pid=141495#p141495</link>
			<description><![CDATA[<p><span class="postimg"><img src="http://dl.dropbox.com/u/4156175/ruby-addition.jpg" alt="http://dl.dropbox.com/u/4156175/ruby-addition.jpg" /></span></p><p>Somebody gave me this problem to solve some time ago:<br />1.Generate an array of 6 numbers(X) (max. 2 digits each)<br />2.Add each following numbers(X) to each other and store the individual scores(Y) in a separate array<br />3.Input a number via keyboard, if matches one of the numbers from array Y display msg, if not restart program.</p><p>Since I`m a total noob, trying my hardest to learn programming, this is what I know so far:<br />1. initilize empty array [x] &amp; [y]<br />2. 6.times.map{ Random.rand(1..99) } <br />3. add numbers using each do?<br />4. store in array [y]<br />5. compare via input to == array [y]<br />6. if any instance matches display msg else restart</p><p>I would be really grateful for any guidance or help with this problem.</p>]]></description>
			<author><![CDATA[dummy@example.com (Big_Bird)]]></author>
			<pubDate>Fri, 24 Jun 2011 19:11:05 +0000</pubDate>
			<guid>http://railsforum.com/viewtopic.php?pid=141495#p141495</guid>
		</item>
	</channel>
</rss>
