Forum: Ruby-Forum.com Trouble with a while loop

7db9cfb27075938a8ee092a72148171c?d=identicon&s=25 Bashka Dooble (bishar)
on 2007-11-30 09:04
Attachment: engBid42.rb (4 KB)
Hi,

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,

--Bashka
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.