This repository contains a web-based implementation of two game theory-based games: Diner's Game and Unique Bid Auction (UBA). These games test players' strategic thinking and decision-making skills in competitive environments.
Storyline:
It's the weekend. You are bored at home, and don't have anything to do, when an idea strikes you. Recently a new restaurant has opened in your neighborhood, so you decide to go for dinner with your friends. But being a game theorist, you decide to do something new.
Rules:
- Each player places an order in the range ₹0 - ₹250 (in multiples of 10)
- The total bill is split equally among all players (everyone pays the average)
- A player's score is the difference between their individual bill and the amount they paid
- The player with the highest individual bill must pay a tip equal to half of their bill, which is deducted from their score
- In case of multiple highest bills, all those players must pay the tip
- The game consists of 3 rounds
- No communication is allowed between opponents during rounds
Rules:
- Each team bids three integers between 1 and 30 (inclusive)
- Prize money is awarded based on bid uniqueness (a bid no other player made)
- Highest unique bid wins ₹50,000
- Lowest unique bid wins ₹25,000
- A fee of ₹(1000 × average of team's three bids) is deducted from prize money
- If a team has both highest and lowest unique bids, they receive both prizes but the fee is deducted only once
- Teams without highest/lowest unique bids neither gain nor lose
- The auction consists of 3 rounds
- If all bids are non-unique, the round is repeated
- No communication is allowed between opponents during rounds
This project is built using:
- React (with JSX)
- Firebase (for database and authentication)
- Tailwind CSS (for styling)
- Vite (as the build tool)
- Shadcn UI components
└── k3tikvats-diners_and_uba_games/
├── README.md
├── components.json
├── eslint.config.js
├── firebaseConfig.js
├── index.html
├── jsconfig.json
├── package.json
├── postcss.config.js
├── tailwind.config.js
├── tsconfig.json
├── tsconfig.node.json
├── vercel.json
├── vite.config.js
├── public/
└── src/
├── App.css
├── App.jsx
├── firebaseDB.js
├── index.css
├── main.jsx
├── assets/
│ └── images/
├── components/
│ ├── DinersFinalScreen.jsx
│ ├── DinersScoreScreen.jsx
│ ├── FinalScreen.jsx
│ ├── GameDashboard.jsx
│ ├── Login.jsx
│ ├── MainScreen.jsx
│ ├── QueueScreen.jsx
│ ├── UbaFinalScreen.jsx
│ ├── UbaFrequencyScreen.jsx
│ ├── UbaScoreScreen.jsx
│ └── ui/
│ ├── card.tsx
│ ├── navigation-menu.tsx
│ └── table.tsx
└── lib/
├── finalScore.js
├── firebase.js
├── roundScores.js
└── utils.ts
- Node.js (v16 or higher)
- npm or yarn
- Firebase account (for database functionality)
- Clone the repository:
git clone https://github.com/k3tikvats/diners_and_uba_games.git
cd diners_and_uba_games- Install dependencies:
npm install
# or
yarn install-
Configure Firebase:
- Create a Firebase project
- Update the
firebaseConfig.jsfile with your Firebase credentials
-
Start the development server:
npm run dev
# or
yarn dev- Open your browser and navigate to
http://localhost:5173
This project is configured for deployment on Vercel. The vercel.json file provides the necessary configuration.
To deploy to Vercel:
- Install Vercel CLI:
npm install -g vercel - Run
vercelfrom the project directory and follow the prompts
DinersScoreScreen.jsx: Displays scores after each roundDinersFinalScreen.jsx: Shows final results after all rounds
UbaFrequencyScreen.jsx: Shows frequency of bidsUbaScoreScreen.jsx: Displays scores after each roundUbaFinalScreen.jsx: Shows final results after all rounds
GameDashboard.jsx: Main game interfaceLogin.jsx: Authentication screenMainScreen.jsx: Game selection interfaceQueueScreen.jsx: Waiting lobby for playersFinalScreen.jsx: Combined final results
This project is licensed under the MIT License - see the LICENSE file for details.
Game rules based on the concepts provided by IGTS-DTU.