SShortSingh.
Back to feed

Developer exhaustively tests Tic-Tac-Toe AI across 1,270 games, records zero losses

0
·8 views

A developer benchmarked a minimax-based Tic-Tac-Toe AI engine to verify claims of it being unbeatable, enumerating all 642 reachable game lines on a 3×3 board and finding the AI never lost. The engine, which uses a full depth-9 minimax search on 3×3 boards, recorded 386 wins and 183 draws when playing second, and 71 wins with 2 draws when playing first. Alpha-beta pruning reduced search node visits by 93% compared to plain minimax, cutting from roughly 550,000 nodes to about 36,500 while producing identical results. Testing was extended to larger boards — 4×4, 5×5, and 6×6 — against random and greedy opponents across 628 simulated games, with the AI still recording zero losses. The developer noted that as board size grows, the AI's depth cap makes forcing a win harder, shifting outcomes toward draws rather than defeats, and released the engine and benchmark code as open source on GitHub.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

Engineer Replaces kube-proxy with eBPF in Homelab, Triggers 6-Hour Monitoring Blackout

A Kubernetes engineer running a four-node bare-metal homelab cluster upgraded Cilium from version 1.15 to 1.16 and enabled full eBPF-based kube-proxy replacement by flipping a single configuration flag. The change appeared successful at first, with all pods reporting healthy status, but at 2:47 AM an alert revealed that the SIEM had stopped receiving any network flow or Kubernetes audit log data. The root cause was that the eBPF datapath bypasses the iptables and conntrack layers that the security monitoring stack depended on to capture traffic. The engineer, who works with managed Kubernetes at Siemens professionally, documented the incident as a cautionary account of how replacing a core networking component can silently blind observability and security tooling. The episode highlights a broader gap in official documentation around eBPF adoption: tools built for the traditional netfilter universe do not automatically carry over into an eBPF-managed datapath.

0
ProgrammingDEV Community ·

Developer builds low-allocation HTTP library for ESP32, cuts RAM use by 99.9%

A software developer created ESP32-HTTP-Client, an open-source C++ library designed to solve chronic memory management problems on ESP32 microcontrollers. Traditional approaches using HTTPClient and ArduinoJson typically allocate around 58 KB of heap per request, often causing crashes in complex embedded projects with Wi-Fi, Bluetooth, and multiple sensors. The new library uses streaming JSON parsing directly from the network socket and writes values straight into target C++ variables, eliminating intermediate buffers and temporary object trees. Benchmarks across 100 consecutive requests showed heap allocation drop from roughly 58 KB to about 15 bytes per request, while average response time fell from 750 ms to 59 ms thanks to persistent TLS Keep-Alive connections. The library has since gained users across multiple countries deploying it in real-world embedded projects.

0
ProgrammingDEV Community ·

Undergraduate Thesis Uses Paraconsistent Logic to Eliminate AppSec False Positives

A software engineering undergraduate developed a security alert triage system using Two-valued Paraconsistent Annotated Logic (LPA2v) to address alert fatigue in application security pipelines. Instead of forcing contradictory scanner outputs into a binary verdict, the system assigns each finding two evidence degrees — favorable and unfavorable — allowing genuine contradictions to be flagged separately for human review. Five domain-specific neurons process signals from SAST, SCA, and DAST tools, feeding into a master neuron that separately aggregates consensus severity and contradiction levels. Tested against 3,005 synthetic events, the LPA2v cluster achieved 100% precision and zero false positives, compared to 8% precision and 2,493 false positives from a plain threshold approach. The trade-off was a recall drop to 65.6%, with missed detections concentrated in single-source evidence scenarios and cases affected by the system's temporal persistence window.

0
ProgrammingDEV Community ·

GitHub Project AI-Copywriter Aims to Blend AI Generation with Human Marketing Voice

A GitHub project called AI-Copywriter, developed by user mikiarlo3, uses Python and natural language processing to generate marketing content that mimics human copywriting. The tool has garnered nearly 1,000 stars on GitHub, reflecting notable interest from the developer community. While it leverages pre-trained large language models to speed up content creation, experts note risks including bias, lack of brand specificity, and the need for extensive fine-tuning. The project also faces design challenges in building a user interface accessible to non-technical marketers without sacrificing customization depth. Its broader ambition is to reconcile algorithmic efficiency with the psychological nuance that effective marketing copy typically demands.