BUILDING 3D Tic-Tac-Toe with Blazor
A Practical Guide to .NET 10, C# 14 and Interactive Web Development
Tic-Tac-Toe sounds simple, until you play it in 3D on a 5x5x5 board. Learn Blazor by building a complete 3D Tic-Tac-Toe game with .NET 10 and C# 14. Along the way, you’ll explore architecture, state management, persistence, AI, and interactive 3D UI through a project that’s both fun to build and rich with real-world lessons.
Minimum price
$24.00
$29.00
You pay
$29.00Author earns
$23.20About
About the Book
A practical Blazor architecture book disguised as a game project.
Building 3D Tic-Tac-Toe with Blazor is a practical, project-driven guide to modern Blazor development using .NET 10 and C# 14. Rather than teaching isolated concepts, the book walks readers through building a complete interactive application step by step—from core game logic and win detection to UI architecture, state management, dynamic layouts, serialization, database persistence, AI gameplay, and a full 3D interface. Along the way, it introduces real-world development practices, modern platform features, responsive design, testing, and architectural decisions that apply far beyond games. The result is a hands-on learning experience that helps developers understand not just how Blazor works, but how to use it to build polished, production-style web applications.
Author
About the Author
Harvey Myers IV is a software developer with more than four decades of experience building business software, solving production problems, and adapting to wave after wave of platform change. His work has ranged from early systems with tight memory and hardware constraints to modern .NET applications built for clarity, maintainability, and long-term usefulness. In this book, he brings that long-view perspective to Blazor development, using a 3D Tic-Tac-Toe project to teach architecture, state management, persistence, and interactive UI design in a practical way. The project may be a game, but the lessons are meant for real software.
Contents
Table of Contents
Building 3D Tic-Tac-Toe with Blazor
- A Practical Guide to .NET 10, C# 14, and Interactive Web Development
Copyright
Author’s Note
Book Introduction
- 🎯 What Makes This Book Different
🧰 Tools of the Trade: Setting Up Your .NET 10 Workshop
- ✅ What You’ll Need
- 🧱 Step-by-Step Installation
- 🧯 Cross-Platform Development
- 📦 Companion Repository
- ✅ Pre-Flight Checklist
Chapter 1: The Engine
- 1.1 Thinking in Cubes (The .NET 10 Perspective)
- 1.2 Setting the Scene (The Modern Way)
- 1.3 Modern Validation and Error Handling
- 1.4 GetPlayer Implementation
- 1.5 Additional Features in GameBoard
- 1.6 Modern Testing
- 📋 What We’ve Modernized
- 📋 Recap: Chapter 1 Goals Achieved
- 🔜 Coming Up Next: Chapter 2 — Enhanced Win Detection
Chapter 2: The Rules of Engagement
- 2.1 The Concept: 26 Directions
- 2.2 Generating the Vectors
- 2.3 The Scanning Algorithm
- 2.4 The Draw Condition
- 2.5 Integrating with MakeMove
- 2.6 Checkpoint: Verifying Victory
- 🧭 Recap: What We Built in Chapter 2
- 📦 Up Next: Chapter 3 — The Headless Game
Chapter 3: The Headless Game
- 3.1 Visualizing the Invisible
- 3.2 Design Decision: Slicing the Cube
- 3.3 The Input Parser
- 3.4 The Game Loop
- 3.5 Game Result Display
- 3.6 Testing Edge Cases
- 🧭 Recap: What We Built in Chapter 3
- 📦 Up Next: Chapter 4 — The View from the Glass
Chapter 4: The View from the Glass
- 4.1 The Architecture Decision
- 4.2 What is MVVM in Blazor?
- 4.3 The Grid System
- 4.4 The Reusable Component — BoardDisplay.razor
- 4.5 The Page Controller — Play.razor
- 4.6 Responsive Design Considerations
- 🧭 Recap: What We Built in Chapter 4
- 📦 Up Next: Chapter 5 — Managing the State
Chapter 5: Managing the State
- 5.1 The Great Refresh Disaster
- 5.2 Why This Happens (Blazor Server 101)
- 5.3 Creating the Game Session Service
- 5.4 Registering the Service in Program.cs
- 5.5 Refactoring the UI to Use the Service
- 5.6 Testing the New Architecture
- 5.7 Understanding SignalR Connection Lifecycle
- 5.8 Extending the Service for Future Features
- 🧭 Recap: What We Built in Chapter 5
- 📦 Up Next: Chapter 6 — Scaling Up
Chapter 6: Scaling Up (Dynamic UI)
- 6.1 Feature Creep, in Three Dimensions
- 6.2 What Should “Dynamic” Actually Mean?
- 6.3 Adding the Size Selector UI
- 6.4 Ensuring CSS Adapts Dynamically
- 6.5 Responsive Adjustments for Larger Boards
- 6.6 Dynamic Cell Sizing with Switch Expression
- 6.7 Testing the Dynamic Layout
- 6.8 Edge Case: What If Someone Tries to Resize Mid-Game?
- 6.9 Performance Considerations
- 6.10 Future Extensibility
- 📋 Final Thoughts from the Devs:
- 📚 Recap: What We Built in Chapter 6
- 🚀 Up Next: Chapter 7 — Freezing Time
Chapter 7: Freezing Time (Serialization)
- 7.1 Memory Is a Feature
- 7.2 What Are We Actually Storing?
- 7.3 Defining the Move Record
- 7.4 Recording Moves in the Engine
- 7.5 AOT-Compatible Serialization
- 7.6 Integrating with GameSession
- 7.7 Real-World Applications
- 📚 Recap: What We Built in Chapter 7
- 🚀 Up Next: Chapter 8 — The Database Connection
Chapter 8: The Database Connection
- 8.1 The Words No Dev Wants to Hear
- 8.2 Why Session State Is Not Enough
- 8.3 Completing the Save/Load Loop
- 8.4 Choosing the Smallest Useful Database
- 8.5 Modeling a Saved Game
- 8.6 Defining the EF Core Context
- 8.7 Building the Persistence Service
- 8.8 Adding Save/Load to
Play.razor - 8.9 Why Player Name Instead of Full Accounts?
- 8.10 SQL Server Later
- 8.11 What We Completed
- Recap
- Up Next: Chapter 9 - The Ghost in the Machine
Chapter 9: The Ghost in the Machine (AI)
- 9.1 When No One Wants to Play With You
- 9.2 The AI Strategy
- 9.3 Difficulty Levels Enum
- 9.4 The AI Engine with Pattern Matching
- 9.5 Updating GameSession for AI Play
- 9.6 Adding Single-Player Mode Toggle and Difficulty Selection
- 9.7 Testing the AI
- 📚 Recap: What We Built in Chapter 9
- 🚀 Up Next: Chapter 10 — The View from the Cube
Chapter 10: The View from the Cube (Play3D)
- 10.1 Day 16 at DimenSoft
- 10.2 What We Are Building
- 10.3 Key Features of Play3D
- 10.4 The Play3D Page Structure
- 10.5 Move Confirmation System
- 10.6 AI Integration in 3D Mode
- 10.7 Board Size Management
- 10.8 Camera Controls
- 10.9 Auto-Rotation and Speed Control
- 10.10 Slice/Isolate Layer Controls
- 10.11 Syncing the 3D Board
- 10.12 3D Click Handling
- 10.13 JavaScript Initialization and Cleanup
- 10.14 New Game Confirmation
- 10.15 .NET 10 Blazor Server Features Used
- 10.16 Architecture Principles
- 10.17 Build and Run
- 📚 Recap: What We Built in Chapter 10
- 🚀 Closing Thoughts
- 🎯 Complete Project Summary
Appendix A: C# and .NET 10 Platform Features
- 🧠 Modern C# Features We’ll Use
- 🚀 .NET 10 Runtime Improvements
- 🎯 Blazor in .NET 10
- 🆚 What’s New Since .NET 8 LTS
Appendix B: Professional Development Practices
- 🐳 Container-First Development
- 🔬 Modern Development Workflow
- 🎓 Learning Resources for .NET 10
About the Author
Companion Resources
The Leanpub 60 Day 100% Happiness Guarantee
Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.
Now, this is technically risky for us, since you'll have the book or course files either way. But we're so confident in our products and services, and in our authors and readers, that we're happy to offer a full money back guarantee for everything we sell.
You can only find out how good something is by trying it, and because of our 100% money back guarantee there's literally no risk to do so!
So, there's no reason not to click the Add to Cart button, is there?
See full terms...
Earn $8 on a $10 Purchase, and $16 on a $20 Purchase
We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.
(Yes, some authors have already earned much more than that on Leanpub.)
In fact, authors have earned over $15 million writing, publishing and selling on Leanpub.
Learn more about writing on Leanpub
Free Updates. DRM Free.
If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).
Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.
Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.
Learn more about Leanpub's ebook formats and where to read them
Write and Publish on Leanpub
You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!
Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.
Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.