NillionNetwork / nada-by-example

Learn the Nada language by working with example Nada programs
https://docs.nillion.com/nada-by-example
MIT License
11 stars 9 forks source link

Price is right game #10

Open oceans404 opened 3 months ago

oceans404 commented 3 months ago

Request a New Nada Example: Price is right game

Description

Create a “Price is Right” style game where multiple parties guess the price of an item, and the winner is the party whose guess is closest to the actual price without exceeding it.

Use Case

This example can be extended to other types of competitive scenarios, such as auctions or bidding systems, making it valuable for developers interested in game theory, competitive pricing models, or privacy-preserving applications.

Specific Requirements

Inputs:

Outputs:

Edge Cases:

ysongh commented 2 months ago

Hello,

I am interested in working on this part. I am confused about this output: 'The guess that is closest to the actual price without exceeding it.' Does this mean the player's input cannot be greater than the price?

oceans404 commented 1 month ago

Hello,

I am interested in working on this part. I am confused about this output: 'The guess that is closest to the actual price without exceeding it.' Does this mean the player's input cannot be greater than the price?

Yes, if a player's guess is higher than the actual price, they can't be the winner. Check out the game logic in this article: https://en.wikipedia.org/wiki/The_Price_Is_Right

ysongh commented 1 month ago

Thank You. I finish and made a pull request. https://github.com/NillionNetwork/nada-by-example/pull/38