Trouble with a while loop


Please forgive if this forum is not the right one for this post.

I’m writing a small ruby program that implements sale of a plot of land
to 5 investors through English Auction. In an English auction, the
auctioneer begins the auction with the reserve price (lowest acceptable
price) and then takes larger and larger bids from the customers until no
one will increase the bid. The item is then sold to the highest bidder.

The logic that i’m using to implement the bidding process is this:

  1. Each investor has a maximum willing price that they can’t exceed.
  2. I calculate the difference or margin btw an investor’s willing price
    and the reserve price
  3. The investor that has the lowest margin bids first
  4. An investor’s first bid = reserve price + half of margin
  5. Subsequent bids = first bid + 25% of margin i.e. half of the other
    half of margin

The code as it is now is attached.

Will appreciate any help with code and advice,