惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

量子位
博客园 - 三生石上(FineUI控件)
D
DataBreaches.Net
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
GbyAI
GbyAI
P
Proofpoint News Feed
Microsoft Security Blog
Microsoft Security Blog
月光博客
月光博客
I
InfoQ
V
Visual Studio Blog
罗磊的独立博客
Engineering at Meta
Engineering at Meta
Vercel News
Vercel News
Jina AI
Jina AI
L
LangChain Blog
Apple Machine Learning Research
Apple Machine Learning Research
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
B
Blog
The Cloudflare Blog
小众软件
小众软件
雷峰网
雷峰网
V
V2EX
人人都是产品经理
人人都是产品经理
Stack Overflow Blog
Stack Overflow Blog

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
SOLSTICE, A shadow capture game in C
Eliott · 2026-06-22 · via DEV Community

Eliott

June Solstice Game Jam Submission

What I Built

A two-player terminal strategy game written in C. No libraries, no graphical engin, just ANSI colors and printf.

Two players place stones on a 9×9 grid. Each stone casts a shadow away from the sun. The shadow captures every cell it crosses, and can recapture enemy territory too. The catch: the sun moves to a new position every turn, constantly shifting shadow directions.

9 stones each, 18 turns. Most cells captured wins.

Video Demo

Code

SOLSTICE — Shadow Capture

A submission for the June Solstice Game Jam 2026


What I Built

SOLSTICE is a two-player terminal strategy game written in C. It runs entirely in the terminal with ASCII rendering and ANSI colors — no external libraries, no graphical engine, just pure C and a bit of sunlight.

The concept is simple: two players, a grid, and a sun that never stays still. Each turn, the sun moves to a new position along the border of the board. You place a stone, and that stone casts a shadow — a long streak of captured territory projected directly away from the sun. The longer the distance between your stone and the sun, the longer the shadow it casts. Place well, and a single stone can sweep across half the board in one move.

After 18 turns, the player who controls the most cells wins.


The Story

How I Built It

Pure C, split across 6 files (main.c, game.c, board.c, player.c, utils.c, game.h). Compile with make, run with ./solstice.

The shadow casting works by computing a direction vector from the sun through the stone, then casting a ray in that direction. The length equals the Chebyshev distance between the stone and the sun — farther sun, longer shadow, just like real life.

The sun follows a precomputed clockwise path around the board with a small random drift each turn, so it's predictable enough to strategize around but never perfectly calculable.

The whole game is basically a simulation of what makes the solstice visually striking — a sun that moves and shadows that follow. The 18-turn structure represents the days around June 21st, and the two-player tension mirrors the solstice duality: longest day for one hemisphere, shortest for the other.