Skip to content

About

AI-Quarto in 3D using negamax with alpha-beta pruning & Three.js UI. A ported enhancement of Uppsala Universitet project: UU-game; applying skills from more (full-stack, UI) web/SE dev, HCI, CG, AI/ML & (data) eng studies completed with distinction either there, the University of Canterbury, the University of Auckland, or formal exchanges abroad

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Repository files navigation

AI-Quarto 3D

AI-Quarto in 3D using negamax with alpha-beta pruning, React UI and Three.js scene. Not affiliated with Gigamic.

A ported enhancement of past Uppsala University project: uni-git-projects/uu-game (below); applying skills from more
studies completed with distinction, including (full-stack, UI) web dev, software eng, HCI, CG, AI/ML, and data eng, etc.

Note: all relevant studies are completed before ChatGPT and other GenAI models have been publicly available.

More specifically, the Python game engine component and CLI are ported and enhanced to an interactive 3D web UI.
From recollection, it was the only, if not best game engine; with all components completed, at least with all members.
However, it wasn't the only time I overcome epic injuries to excel under eternal 24/7 harassment, wrongdoing plagues.

UU-Game group: uu-game-contribution-graph

UU-Game PO:

Davide Vega D'Aurelio

Install

npm install

Development

npm run dev

Build

npm run build
npm run preview

Test

npm test

Example

stdout | tests/ai-diff.test.ts > 100-match AI vs AI > hard vs hard: 100 draws
┌─────────┬──────────────────────────────────┬─────────────────┬──────────────────┬──────────────────┬──────────────┬───────────────┬─────────────┐
│ (index) │ testName                         │ expectedOutcome │ numPlayerOneWins │ numPlayerTwoWins │ numGameDraws │ numTestPasses │ numTestRuns │
├─────────┼──────────────────────────────────┼─────────────────┼──────────────────┼──────────────────┼──────────────┼───────────────┼─────────────┤
│ 0       │ 'hard P1 vs hard P2 — P1 starts' │ 'draw'          │ 0                │ 0                │ 25           │ 25            │ 25          │
│ 1       │ 'hard P1 vs hard P2 — P2 starts' │ 'draw'          │ 0                │ 0                │ 25           │ 25            │ 25          │
│ 2       │ 'hard P2 vs hard P1 — P1 starts' │ 'draw'          │ 0                │ 0                │ 25           │ 25            │ 25          │
│ 3       │ 'hard P2 vs hard P1 — P2 starts' │ 'draw'          │ 0                │ 0                │ 25           │ 25            │ 25          │
└─────────┴──────────────────────────────────┴─────────────────┴──────────────────┴──────────────────┴──────────────┴───────────────┴─────────────┘

stdout | tests/ai-diff.test.ts > 100-match AI vs AI > hard vs medium: 100 hard wins
┌─────────┬────────────────────────────────────┬─────────────────┬──────────────────┬──────────────────┬──────────────┬───────────────┬─────────────┐
│ (index) │ testName                           │ expectedOutcome │ numPlayerOneWins │ numPlayerTwoWins │ numGameDraws │ numTestPasses │ numTestRuns │
├─────────┼────────────────────────────────────┼─────────────────┼──────────────────┼──────────────────┼──────────────┼───────────────┼─────────────┤
│ 0       │ 'hard P1 vs medium P2 — P1 starts' │ 'player1'       │ 25               │ 0                │ 0            │ 25            │ 25          │
│ 1       │ 'hard P1 vs medium P2 — P2 starts' │ 'player1'       │ 25               │ 0                │ 0            │ 25            │ 25          │
│ 2       │ 'medium P2 vs hard P1 — P1 starts' │ 'player2'       │ 0                │ 25               │ 0            │ 25            │ 25          │
│ 3       │ 'medium P2 vs hard P1 — P2 starts' │ 'player2'       │ 0                │ 25               │ 0            │ 25            │ 25          │
└─────────┴────────────────────────────────────┴─────────────────┴──────────────────┴──────────────────┴──────────────┴───────────────┴─────────────┘

stdout | tests/ai-diff.test.ts > 100-match AI vs AI > hard vs easy: 100 hard wins
┌─────────┬──────────────────────────────────┬─────────────────┬──────────────────┬──────────────────┬──────────────┬───────────────┬─────────────┐
│ (index) │ testName                         │ expectedOutcome │ numPlayerOneWins │ numPlayerTwoWins │ numGameDraws │ numTestPasses │ numTestRuns │
├─────────┼──────────────────────────────────┼─────────────────┼──────────────────┼──────────────────┼──────────────┼───────────────┼─────────────┤
│ 0       │ 'hard P1 vs easy P2 — P1 starts' │ 'player1'       │ 25               │ 0                │ 0            │ 25            │ 25          │
│ 1       │ 'hard P1 vs easy P2 — P2 starts' │ 'player1'       │ 25               │ 0                │ 0            │ 25            │ 25          │
│ 2       │ 'easy P2 vs hard P1 — P1 starts' │ 'player2'       │ 0                │ 25               │ 0            │ 25            │ 25          │
│ 3       │ 'easy P2 vs hard P1 — P2 starts' │ 'player2'       │ 0                │ 25               │ 0            │ 25            │ 25          │
└─────────┴──────────────────────────────────┴─────────────────┴──────────────────┴──────────────────┴──────────────┴───────────────┴─────────────┘

stdout | tests/ai-diff.test.ts > 100-match AI vs AI > medium vs easy: 100 medium wins
┌─────────┬────────────────────────────────────┬─────────────────┬──────────────────┬──────────────────┬──────────────┬───────────────┬─────────────┐
│ (index) │ testName                           │ expectedOutcome │ numPlayerOneWins │ numPlayerTwoWins │ numGameDraws │ numTestPasses │ numTestRuns │
├─────────┼────────────────────────────────────┼─────────────────┼──────────────────┼──────────────────┼──────────────┼───────────────┼─────────────┤
│ 0       │ 'medium P1 vs easy P2 — P1 starts' │ 'player1'       │ 25               │ 0                │ 0            │ 25            │ 25          │
│ 1       │ 'medium P1 vs easy P2 — P2 starts' │ 'player1'       │ 25               │ 0                │ 0            │ 25            │ 25          │
│ 2       │ 'easy P2 vs medium P1 — P1 starts' │ 'player2'       │ 0                │ 25               │ 0            │ 25            │ 25          │
│ 3       │ 'easy P2 vs medium P1 — P2 starts' │ 'player2'       │ 0                │ 25               │ 0            │ 25            │ 25          │
└─────────┴────────────────────────────────────┴─────────────────┴──────────────────┴──────────────────┴──────────────┴───────────────┴─────────────┘

 ✓ tests/ai-diff.test.ts (4 tests) 2092780ms
   ✓ 100-match AI vs AI (4)
     ✓ hard vs hard: 100 draws  708530ms
     ✓ hard vs medium: 100 hard wins  714410ms
     ✓ hard vs easy: 100 hard wins  587404ms
     ✓ medium vs easy: 100 medium wins  82431ms

 Test Files  1 passed (1)
      Tests  4 passed (4)

Contribute

Before making a Pull Request, ensure it addresses an Issue, and verify the branch passes:

npm run verify:fix

About

AI-Quarto in 3D using negamax with alpha-beta pruning & Three.js UI. A ported enhancement of Uppsala Universitet project: UU-game; applying skills from more (full-stack, UI) web/SE dev, HCI, CG, AI/ML & (data) eng studies completed with distinction either there, the University of Canterbury, the University of Auckland, or formal exchanges abroad

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Contributors

Languages