title: VB.Net - Recursion or Iteration
body: <p>first post here because I've got a problem thats got me stumped. I am creating a calculation tool for a project at uni, now I'm not in an it degree but for this project I havent had problem too difficult until now.</p>
  
  <p>Basically I am doing design work for a building, where each floor of the building can be allocated one of 9 possible designs. By then allocating solutions to each of these then calculating costs I am trying to find the most efficient combination. </p>
  
  <p>Normally I would just use some nested loops to find the best design, no problems, but for the calculation tool I am required to change the number of floors, and therefore the number of nested loops, which I am unfamiliar with how to do.</p>
  
  <p>The General structure is this</p>
  
  <p>1- X Number of Floors.</p>
  
  <p>9 Possible designs for each floor.</p>
  
  <p>Based on each combination a cost must be calculated, and if it is within the best 5 results it will be stored.</p>
  
  <p>There is a total of 9^x total solutions.</p>
  
  <p>So</p>
  
  <pre><code>Floor = 1
  For Solution = 1 to 9
  
    Floor = 2
    For Solution = 1 to 9
  
        CalculateCost()
        if CalculateCost &lt; Best Then
        Write, Floor1 Solution Value, Floor2 Solution Value to Output
  </code></pre>
  
  <p>Etc...</p>
  
  <p>Now I am using Vb.net, and do not really know how to do recursion. If someone could simply point me in the way of a resource that may help me on this issue I would be very grateful. </p>
  
  <p>Edit - Whilst I have tried to simplify, the cost of design implementation changes based on various other factors, so I can't simply just take the cheapest design for all. I have tried to solve this through practical theory and so far found so solution, therefore the brute force method is required</p>