Leanpub Header

Skip to main content

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.00

Author earns

$23.20
$
You can also buy this book with 1 book credit. Get book credits with a Reader Membership or an Organization Membership for your team.
PDF
EPUB
WEB
About

About

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.

Share this book

Categories

Author

About the Author

Harvey Myers IV
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

  1. A Practical Guide to .NET 10, C# 14, and Interactive Web Development

Copyright

Author’s Note

Book Introduction

  1. 🎯 What Makes This Book Different

🧰 Tools of the Trade: Setting Up Your .NET 10 Workshop

  1. ✅ What You’ll Need
  2. 🧱 Step-by-Step Installation
  3. 🧯 Cross-Platform Development
  4. 📦 Companion Repository
  5. ✅ Pre-Flight Checklist

Chapter 1: The Engine

  1. 1.1 Thinking in Cubes (The .NET 10 Perspective)
  2. 1.2 Setting the Scene (The Modern Way)
  3. 1.3 Modern Validation and Error Handling
  4. 1.4 GetPlayer Implementation
  5. 1.5 Additional Features in GameBoard
  6. 1.6 Modern Testing
  7. 📋 What We’ve Modernized
  8. 📋 Recap: Chapter 1 Goals Achieved
  9. 🔜 Coming Up Next: Chapter 2 — Enhanced Win Detection

Chapter 2: The Rules of Engagement

  1. 2.1 The Concept: 26 Directions
  2. 2.2 Generating the Vectors
  3. 2.3 The Scanning Algorithm
  4. 2.4 The Draw Condition
  5. 2.5 Integrating with MakeMove
  6. 2.6 Checkpoint: Verifying Victory
  7. 🧭 Recap: What We Built in Chapter 2
  8. 📦 Up Next: Chapter 3 — The Headless Game

Chapter 3: The Headless Game

  1. 3.1 Visualizing the Invisible
  2. 3.2 Design Decision: Slicing the Cube
  3. 3.3 The Input Parser
  4. 3.4 The Game Loop
  5. 3.5 Game Result Display
  6. 3.6 Testing Edge Cases
  7. 🧭 Recap: What We Built in Chapter 3
  8. 📦 Up Next: Chapter 4 — The View from the Glass

Chapter 4: The View from the Glass

  1. 4.1 The Architecture Decision
  2. 4.2 What is MVVM in Blazor?
  3. 4.3 The Grid System
  4. 4.4 The Reusable Component — BoardDisplay.razor
  5. 4.5 The Page Controller — Play.razor
  6. 4.6 Responsive Design Considerations
  7. 🧭 Recap: What We Built in Chapter 4
  8. 📦 Up Next: Chapter 5 — Managing the State

Chapter 5: Managing the State

  1. 5.1 The Great Refresh Disaster
  2. 5.2 Why This Happens (Blazor Server 101)
  3. 5.3 Creating the Game Session Service
  4. 5.4 Registering the Service in Program.cs
  5. 5.5 Refactoring the UI to Use the Service
  6. 5.6 Testing the New Architecture
  7. 5.7 Understanding SignalR Connection Lifecycle
  8. 5.8 Extending the Service for Future Features
  9. 🧭 Recap: What We Built in Chapter 5
  10. 📦 Up Next: Chapter 6 — Scaling Up

Chapter 6: Scaling Up (Dynamic UI)

  1. 6.1 Feature Creep, in Three Dimensions
  2. 6.2 What Should “Dynamic” Actually Mean?
  3. 6.3 Adding the Size Selector UI
  4. 6.4 Ensuring CSS Adapts Dynamically
  5. 6.5 Responsive Adjustments for Larger Boards
  6. 6.6 Dynamic Cell Sizing with Switch Expression
  7. 6.7 Testing the Dynamic Layout
  8. 6.8 Edge Case: What If Someone Tries to Resize Mid-Game?
  9. 6.9 Performance Considerations
  10. 6.10 Future Extensibility
  11. 📋 Final Thoughts from the Devs:
  12. 📚 Recap: What We Built in Chapter 6
  13. 🚀 Up Next: Chapter 7 — Freezing Time

Chapter 7: Freezing Time (Serialization)

  1. 7.1 Memory Is a Feature
  2. 7.2 What Are We Actually Storing?
  3. 7.3 Defining the Move Record
  4. 7.4 Recording Moves in the Engine
  5. 7.5 AOT-Compatible Serialization
  6. 7.6 Integrating with GameSession
  7. 7.7 Real-World Applications
  8. 📚 Recap: What We Built in Chapter 7
  9. 🚀 Up Next: Chapter 8 — The Database Connection

Chapter 8: The Database Connection

  1. 8.1 The Words No Dev Wants to Hear
  2. 8.2 Why Session State Is Not Enough
  3. 8.3 Completing the Save/Load Loop
  4. 8.4 Choosing the Smallest Useful Database
  5. 8.5 Modeling a Saved Game
  6. 8.6 Defining the EF Core Context
  7. 8.7 Building the Persistence Service
  8. 8.8 Adding Save/Load to Play.razor
  9. 8.9 Why Player Name Instead of Full Accounts?
  10. 8.10 SQL Server Later
  11. 8.11 What We Completed
  12. Recap
  13. Up Next: Chapter 9 - The Ghost in the Machine

Chapter 9: The Ghost in the Machine (AI)

  1. 9.1 When No One Wants to Play With You
  2. 9.2 The AI Strategy
  3. 9.3 Difficulty Levels Enum
  4. 9.4 The AI Engine with Pattern Matching
  5. 9.5 Updating GameSession for AI Play
  6. 9.6 Adding Single-Player Mode Toggle and Difficulty Selection
  7. 9.7 Testing the AI
  8. 📚 Recap: What We Built in Chapter 9
  9. 🚀 Up Next: Chapter 10 — The View from the Cube

Chapter 10: The View from the Cube (Play3D)

  1. 10.1 Day 16 at DimenSoft
  2. 10.2 What We Are Building
  3. 10.3 Key Features of Play3D
  4. 10.4 The Play3D Page Structure
  5. 10.5 Move Confirmation System
  6. 10.6 AI Integration in 3D Mode
  7. 10.7 Board Size Management
  8. 10.8 Camera Controls
  9. 10.9 Auto-Rotation and Speed Control
  10. 10.10 Slice/Isolate Layer Controls
  11. 10.11 Syncing the 3D Board
  12. 10.12 3D Click Handling
  13. 10.13 JavaScript Initialization and Cleanup
  14. 10.14 New Game Confirmation
  15. 10.15 .NET 10 Blazor Server Features Used
  16. 10.16 Architecture Principles
  17. 10.17 Build and Run
  18. 📚 Recap: What We Built in Chapter 10
  19. 🚀 Closing Thoughts
  20. 🎯 Complete Project Summary

Appendix A: C# and .NET 10 Platform Features

  1. 🧠 Modern C# Features We’ll Use
  2. 🚀 .NET 10 Runtime Improvements
  3. 🎯 Blazor in .NET 10
  4. 🆚 What’s New Since .NET 8 LTS

Appendix B: Professional Development Practices

  1. 🐳 Container-First Development
  2. 🔬 Modern Development Workflow
  3. 🎓 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.

Learn more about writing on Leanpub