title: Adding Elements in a Array
body: <p>I have the following problem:</p>
  
  <ol>
  <li>There is an array that consists of 6 numbers, each two digits at maximum.</li>
  <li><em>Y</em> is an array whose <em>i</em> th element is the sum of the first <em>i</em> +1 elements of the first array.</li>
  <li>Accept a numerical input via keyboard. If it matches one of the numbers in <em>Y</em> display a message; If not, restart the program.</li>
  </ol>
  
  <p><img src="https://i.stack.imgur.com/peSpV.jpg" alt="Diagram"></p>
  
  <p>This is the algorithm that I am thinking:</p>
  
  <ul>
  <li>Initialize empty array [x] &amp; [y]</li>
  <li>6.times.map{ Random.rand(1..99) }</li>
  <li>Add numbers using each do?</li>
  <li>Store in array [y ]</li>
  <li>Compare input to == array [y]</li>
  <li>If any instance matches display msg else restart</li>
  </ul>
  
  <p>I would be really grateful for any guidance or help with this problem.</p>