Challenge: Complex Orders
Currently, a patron at Taernyl’s Folly must order one item at a time. If they want to order both food and drink, they must place two separate orders. Flesh out the tavern’s ordering system by allowing patrons to place orders for multiple items.
Patrons should place orders with 1-3 items in their order, with both the number and the items selected randomly. If a patron cannot afford their entire order, the sale should be denied, and they should not be served any items until they place a different order. You may need to give patrons more gold to afford some more expensive meal combinations.
(Be sure to save a copy of NyetHack before you make these changes. The next chapter will introduce many changes to the ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access