• Blog
  • Docs
  • Pricing
  • We’re hiring!
Log inSign up
saolsen

saolsen

connect4_ai

Parallel connect4 bot in a webgpu compute shader.
Public
Like
connect4_ai
Home
Code
8
.vtignore
AGENTS.md
README.md
connect4_ai.js
connect4_ai.wgsl
deno.json
index.html
H
server.ts
Branches
1
Pull requests
Remixes
History
Environment variables
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Sign up now
Code
/
README.md
Code
/
README.md
Search
11/5/2025
Viewing readonly version of main branch: v1223
View latest version
README.md

connect4_ai

A parallel connect4 AI player written in a webgpu shader.

Does a minimax evaluation on the current game state, looking 8 moves ahead at all possible game states. Expands the tree out 3 levels which results in 343 game states, those are then each evaluated on a gpu thread to check 5 more moves ahead. All in all it looks at 5,764,801 different game states to make it's decision.

Runs pretty quickly on an M series mac or on a computer with a good gpu. Can be kinda slow if you only have an integrated gpu and probably don't work at all on most phones.

FeaturesVersion controlCode intelligenceCLIMCP
Use cases
TeamsAI agentsSlackGTM
DocsShowcaseTemplatesNewestTrendingAPI examplesNPM packages
PricingNewsletterBlogAboutCareers
We’re hiring!
Brandhi@val.townStatus
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Open Source Pledge
Terms of usePrivacy policyAbuse contact
© 2025 Val Town, Inc.