Skip to content

JMarcSyd/six-takes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

6 Takes! — LAN multiplayer

A web-based version of the card game 6 nimmt! / 6 Takes! for playing with family or friends on a local network. No login, no database.

  • Real-time multiplayer via WebSockets
  • 2–10 players per game — any mix of humans and bots
  • Each human on their own device (laptop, tablet, phone)
  • Mobile-friendly layout with compact cards on small screens
  • Reconnect after a dropped connection or a locked phone — your slot is held and your hand restored
  • Manual card placement: cards reveal lowest-first and the owner clicks the row to place
  • Player names shown on each played card so you can see who did what
  • In-memory game state — restart the server to fully reset
  • Host controls: choose end condition at game start ("first to N bull heads loses", default 66, or "fixed number of hands", default 5), kick players in the lobby, reset the whole room mid-game
  • Per-player controls: Leave button returns you to the join screen; if you leave mid-game your seat is taken over by a bot so the rest of the table can keep playing

Install on Debian 12

# 1. Install Node.js (LTS) if you don't have it
sudo apt update
sudo apt install -y nodejs npm

# Verify (need Node 18+)
node --version

# If your distro's nodejs is too old, install from NodeSource instead:
# curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
# sudo apt install -y nodejs

# 2. Clone and install
git clone https://github.com/JMarcSyd/six-takes.git
cd six-takes
npm install

# 3. Run it
npm start
# → "6 Takes! server listening on http://0.0.0.0:3000"

Players on the LAN open http://<server-ip>:3000 in any modern browser.

Run as a systemd service (optional)

Create /etc/systemd/system/sixtakes.service:

[Unit]
Description=6 Takes! game server
After=network.target

[Service]
Type=simple
User=youruser
WorkingDirectory=/path/to/six-takes
ExecStart=/usr/bin/node server.js
Restart=on-failure
Environment=PORT=3000

[Install]
WantedBy=multi-user.target

Then:

sudo systemctl daemon-reload
sudo systemctl enable --now sixtakes

Behind Apache (optional)

If you want to reach it on port 80 via Apache, enable a reverse proxy with WebSocket support:

sudo a2enmod proxy proxy_http proxy_wstunnel rewrite

Then add a vhost (or extend an existing one):

<VirtualHost *:80>
    ServerName sixtakes.lan

    ProxyPreserveHost On
    ProxyPass        /socket.io/ ws://127.0.0.1:3000/socket.io/
    ProxyPassReverse /socket.io/ ws://127.0.0.1:3000/socket.io/
    ProxyPass        / http://127.0.0.1:3000/
    ProxyPassReverse / http://127.0.0.1:3000/
</VirtualHost>

If you don't need port 80, just running on :3000 directly is simpler.

How it plays

  1. First person to join becomes the host. They pick the end condition, optionally add bot players, and click Start game.
  2. Each hand: 10 cards dealt to each player, 4 starting rows.
  3. Every round, all players simultaneously select a card (you can change your mind until everyone has locked in).
  4. Once all picks are in, the cards reveal sorted lowest-first. For each card in turn, the owner clicks the target row to place it:
    • If your card is the 6th in a row → you take the previous 5 cards (penalty bull heads).
    • If your card is lower than every row top → you choose which row to take.
  5. Bots place their own cards automatically after a short randomized delay.
  6. After 10 rounds the hand ends. Host clicks Deal next hand.
  7. Game ends per the chosen end condition. Lowest bull heads wins.

Reconnect & leave

  • Your browser stores a small reconnect token in localStorage. If you refresh, lock your phone, or briefly lose Wi-Fi, you come back into the same seat with your hand intact.
  • The Leave button in the top-right returns you to the join screen. Mid-game leavers are converted to bots so the rest of the table can keep playing without a re-deal.
  • The host has an extra Reset button (top-right) that wipes the room back to an empty lobby — equivalent to restarting the server.

Files

  • server.js — Express + Socket.io transport and the single in-memory room
  • game.js — Pure game rules (deck, dealing, trick resolution, scoring, bot heuristic)
  • public/index.html, public/style.css, public/client.js — the browser UI
  • CLAUDE.md — architecture notes for future contributors / AI assistants

Notes

  • Single room only — designed for one household. Two simultaneous games on the same server are not supported.
  • Bots are pure CPU (a simple scoring heuristic in game.js); no LLM or external service is involved.

About

Web based version of Six Takes game written in JS

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages