Skip to content

Comments

Add AI-based Who Wants to Be a Millionaire game#129

Merged
voodoohop merged 3 commits intomainfrom
mentat-128-1-millionaire-game-implementation
Jan 16, 2025
Merged

Add AI-based Who Wants to Be a Millionaire game#129
voodoohop merged 3 commits intomainfrom
mentat-128-1-millionaire-game-implementation

Conversation

@mentatbot
Copy link
Contributor

@mentatbot mentatbot bot commented Jan 16, 2025

Implements a vanilla HTML/JS version of Who Wants to Be a Millionaire with AI-powered features:

Features:

  • AI-generated questions with increasing difficulty using Pollinations Text API
  • Four AI-powered help lines:
    • Phone A Friend: AI simulates an expert friend's advice
    • Ask The Audience: Simulated audience poll with difficulty-based accuracy
    • 50:50: Removes two wrong answers
    • Ask The Host: AI host provides subtle hints
  • Classic game show UI with:
    • Money ladder showing progress and safe havens
    • Visual feedback for answers
    • Dramatic pauses for tension
  • Responsive design that works on mobile and desktop

Technical Details:

  • Uses vanilla HTML/CSS/JS for simplicity and performance
  • Implements OOP principles with a MillionaireGame class
  • Uses Pollinations Text API for question generation and help lines
  • Includes error handling and fallbacks

Closes #128


Precommit Logs: 97d505e ✅9797ed3 ✅d5cf000 ✅

🤖 See my steps and track the cost of the PR here

Implements a vanilla HTML/JS version of Who Wants to Be a Millionaire with AI-powered features:

Features:
- AI-generated questions with increasing difficulty using Pollinations Text API
- Four AI-powered help lines:
  - Phone A Friend: AI simulates an expert friend's advice
  - Ask The Audience: Simulated audience poll with difficulty-based accuracy
  - 50:50: Removes two wrong answers
  - Ask The Host: AI host provides subtle hints
- Classic game show UI with:
  - Money ladder showing progress and safe havens
  - Visual feedback for answers
  - Dramatic pauses for tension
- Responsive design that works on mobile and desktop

Technical Details:
- Uses vanilla HTML/CSS/JS for simplicity and performance
- Implements OOP principles with a MillionaireGame class
- Uses Pollinations Text API for question generation and help lines
- Includes error handling and fallbacks

Closes # 128

Mentat precommits passed. Log: https://mentat.ai/log/0c03d342-3379-4243-86db-e4d5201f9601
@mentatbot mentatbot bot requested a review from voodoohop January 16, 2025 12:48
Copy link
Contributor Author

@mentatbot mentatbot bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've implemented the Who Wants to Be a Millionaire game using vanilla HTML/JS/CSS for simplicity and fast loading. Here's how to test the game:

  1. Open millionaire-game/index.html in a web browser
  2. Click "Start Game" to begin
  3. Each question is generated in real-time by the AI, with difficulty increasing as you progress
  4. You can use each help line once:
    • 50:50: Removes two wrong answers
    • Phone A Friend: AI simulates an expert friend giving advice
    • Ask The Audience: Shows a simulated audience poll (more accurate for easier questions)
    • Ask The Host: AI host provides a subtle hint

Technical notes:

  • Questions are generated using the Pollinations Text API with increasing difficulty levels (0-9)
  • Help lines use different system prompts to generate appropriate responses
  • The game includes safe havens at $1,000 and $50,000
  • UI includes dramatic pauses and visual feedback for a more engaging experience

Let me know if you'd like any adjustments to the implementation!

Thanks for using MentatBot. Give comments a 👍 or 👎 to help me improve!
You can change my review settings on my settings page.

@github-actions
Copy link
Contributor

🚀 PR Preview deployed!

Preview URL: https://pollinations.github.io/hive/pr-129/

@mentatbot
Copy link
Contributor Author

mentatbot bot commented Jan 16, 2025

Hi @github-actions[bot]! You need to be added as a user to interact with me. Please ask @voodoohop to add you on the settings page.

- Updated the CSS file path to use relative path
- This fixes the CI test failure where the CSS file couldn't be found

Mentat precommits passed. Log: https://mentat.ai/log/8f387db3-06f7-455e-9b68-3ad3bcd1b5f0
@github-actions
Copy link
Contributor

🚀 PR Preview deployed!

Preview URL: https://pollinations.github.io/hive/pr-129/

@mentatbot
Copy link
Contributor Author

mentatbot bot commented Jan 16, 2025

Hi @github-actions[bot]! You need to be added as a user to interact with me. Please ask @voodoohop to add you on the settings page.

@voodoohop
Copy link
Member

@MentatBot Uncaught (in promise) TypeError: this.updateUI is not a function
at MillionaireGame.startGame (script.js:60:14)
at HTMLButtonElement. (script.js:36:63)Understand this errorAI

- Organized files into src directory
- Updated paths in index.html to point to src directory
- Removed non-existent updateUI call from startGame method

Mentat precommits passed. Log: https://mentat.ai/log/4dffa4d4-1b70-455f-bfc8-3f6a3767145f
@github-actions
Copy link
Contributor

🚀 PR Preview deployed!

Preview URL: https://pollinations.github.io/hive/pr-129/

@mentatbot
Copy link
Contributor Author

mentatbot bot commented Jan 16, 2025

Hi @github-actions[bot]! You need to be added as a user to interact with me. Please ask @voodoohop to add you on the settings page.

@SteamPoweredCat
Copy link

script.js:60 Uncaught (in promise) TypeError: this.updateUI is not a function
at MillionaireGame.startGame (script.js:60:14)
at HTMLButtonElement. (script.js:36:63)

Start is not working.

@mentatbot
Copy link
Contributor Author

mentatbot bot commented Jan 16, 2025

Hi @SteamPoweredCat! You need to be added as a user to interact with me. Please ask @voodoohop to add you on the settings page.

@voodoohop
Copy link
Member

@MentatBot

Run npm test

hive@1.0.6 test
node scripts/test-apps.js

Testing .mentat

Testing ai-chat
Testing static HTML app: ai-chat

Testing graphics-editor
Testing static HTML app: graphics-editor

Testing llm-feedback
Testing static HTML app: llm-feedback

Testing millionaire-game
Testing static HTML app: millionaire-game
File not found: /home/runner/work/hive/hive/styles.css
Error in millionaire-game/index.html: Failed to load resource: the server responded with a status of 404 (Not Found)
❌ HTML tests failed for millionaire-game

Testing placeholder-generator
Testing Node.js app: placeholder-generator
Installing dependencies...
npm warn deprecated inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
npm warn deprecated rimraf@3.0.2: Rimraf versions prior to v4 are no longer supported
npm warn deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported
npm warn deprecated @humanwhocodes/object-schema@2.0.3: Use @eslint/object-schema instead
npm warn deprecated @humanwhocodes/config-array@0.13.0: Use @eslint/config-array instead
npm warn deprecated eslint@8.57.1: This version is no longer supported. Please see https://eslint.org/version-support for other options.

added 273 packages, and audited 274 packages in 10s

108 packages are looking for funding
run npm fund for details

found 0 vulnerabilities
ℹ️ No tests found
Building...

placeholder-generator@0.0.0 build
vite build

vite v5.4.11 building for production...
transforming...
✓ 32 modules transformed.
rendering chunks...
computing gzip size...
dist/index.html 0.45 kB │ gzip: 0.28 kB
dist/assets/index-Xy5EDiQ3.css 1.25 kB │ gzip: 0.61 kB
dist/assets/index-BAcusHwb.js 144.97 kB │ gzip: 46.73 kB
✓ built in 865ms

Testing pollinations-image-show
Testing Node.js app: pollinations-image-show
Installing dependencies...

added 314 packages, and audited 315 packages in 12s

118 packages are looking for funding
run npm fund for details

found 0 vulnerabilities
ℹ️ No tests found
Building...

pollinations-image-show@0.0.0 build
vite build

vite v6.0.7 building for production...
transforming...
969 modules transformed.
rendering chunks...
computing gzip size...
dist/index.html 0.46 kB │ gzip: 0.29 kB
dist/assets/index-Ck1XBn8h.css 0.56 kB │ gzip: 0.32 kB
dist/assets/index-COrGKCAO.js 311.91 kB │ gzip: 104.05 kB
✓ built in 2.82s

Testing tarot-reader
Testing Node.js app: tarot-reader
Installing dependencies...

added 324 packages, and audited 325 packages in 3s

155 packages are looking for funding
run npm fund for details

found 0 vulnerabilities
ℹ️ No tests found
Building...

tarot-reader@0.0.0 build
vite build

vite v6.0.7 building for production...
transforming...
✓ 34 modules transformed.
rendering chunks...
computing gzip size...
dist/index.html 0.56 kB │ gzip: 0.33 kB
dist/assets/index-tTF554dA.css 2.48 kB │ gzip: 1.03 kB
dist/assets/index-BxXiSpNq.js 149.43 kB │ gzip: 48.71 kB
✓ built in 947ms

❌ Some tests failed
Error: Process completed with exit code 1.

@voodoohop voodoohop merged commit 2c50a09 into main Jan 16, 2025
3 checks passed
github-actions bot pushed a commit that referenced this pull request Jan 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AI-based "Who Wants to Be a Millionaire?" game

2 participants