{"@attributes":{"version":"2.0"},"channel":{"title":"DEV Community: Mohammed Thaha","description":"The latest articles on DEV Community by Mohammed Thaha (@mohammed_thaha).","link":"https:\/\/dev.to\/mohammed_thaha","image":{"url":"https:\/\/media2.dev.to\/dynamic\/image\/width=90,height=90,fit=cover,gravity=auto,format=auto\/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1881433%2F06bbad1d-1515-4b2a-9e92-e8d33eb55061.png","title":"DEV Community: Mohammed Thaha","link":"https:\/\/dev.to\/mohammed_thaha"},"language":"en","item":[{"title":"Deal Agent Forge: AI-Powered Tech Builder with Conversational Intelligence","pubDate":"Tue, 03 Feb 2026 19:44:27 +0000","link":"https:\/\/dev.to\/mohammed_thaha\/deal-agent-forge-ai-powered-tech-builder-with-conversational-intelligence-1b2d","guid":"https:\/\/dev.to\/mohammed_thaha\/deal-agent-forge-ai-powered-tech-builder-with-conversational-intelligence-1b2d","description":"<p><em>This is a submission for the <a href=\"https:\/\/dev.to\/challenges\/algolia\">Algolia Agent Studio Challenge<\/a>: Consumer-Facing Conversational Experiences<\/em><\/p>\n\n<h2>\n  \n  \n  <strong>What I Built<\/strong>\n<\/h2>\n\n<p>Deal Agent Forge is an AI-powered conversational configurator that simplifies building Gaming PCs, Professional Drones, and Solar Power Systems by giving users rapid, accurate recommendations without overwhelming technical research.<\/p>\n\n<p>Instead of manually checking specs, compatibility, and prices across multiple sites, users interact with a chat-based assistant that:<\/p>\n\n<p>Understands <strong>natural language<\/strong> requirements<br>\nRetrieves relevant product <strong>data instantly<\/strong><br>\nGuides users through <strong>build recommendations<\/strong><br>\nChecks <strong>compatibility<\/strong> and <strong>cost-performance<\/strong> tradeoffs<br>\nSuggests <strong>optimized configurations<\/strong> based on context<\/p>\n<h2>\n  \n  \n  <strong>Demo<\/strong>\n<\/h2>\n\n<p>Live Demo: <a href=\"https:\/\/deal-agent-forge.vercel.app\" rel=\"noopener noreferrer\">Deal Agent Forge<\/a><br>\nGitHub: <a href=\"https:\/\/github.com\/Mohammed-Thaha\/DealAgentForge\" rel=\"noopener noreferrer\">Github Link<\/a><br>\nVideo Demo:<br>\n\n\n  <iframe src=\"https:\/\/www.youtube.com\/embed\/1wuK7Ap7pNQ\">\n  <\/iframe>\n\n\n<\/p>\n\n<h3>\n  \n  \n  Key Features in Action:\n<\/h3>\n\n<ul>\n<li><p><strong>ProductLens Exploration<\/strong><br>\n<em>Browse curated builds with tag-based filtering and intelligent search<\/em><br>\n<a href=\"https:\/\/media2.dev.to\/dynamic\/image\/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto\/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjcigzrlif3r7usjekj00.png\" class=\"article-body-image-wrapper\"><img src=\"https:\/\/media2.dev.to\/dynamic\/image\/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto\/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjcigzrlif3r7usjekj00.png\" alt=\"ProductLens Interface\"><\/a><\/p><\/li>\n<li><p><strong>Conversational Product Discovery<\/strong><br>\n<em>The Algolia-powered chatbot provides intelligent recommendations and answers complex technical questions<\/em><br>\n<a href=\"https:\/\/media2.dev.to\/dynamic\/image\/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto\/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0lj51twygi0stwskraw4.png\" class=\"article-body-image-wrapper\"><img src=\"https:\/\/media2.dev.to\/dynamic\/image\/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto\/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0lj51twygi0stwskraw4.png\" alt=\" \"><\/a><\/p><\/li>\n<li><p><strong>Interactive 3D Components<\/strong><br>\n<em>Explore components with interactive 3D models powered by Three.js<\/em><br>\n<a href=\"https:\/\/media2.dev.to\/dynamic\/image\/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto\/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdyj7qdch4ttth9vcmfim.png\" class=\"article-body-image-wrapper\"><img src=\"https:\/\/media2.dev.to\/dynamic\/image\/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto\/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdyj7qdch4ttth9vcmfim.png\" alt=\"3D Models\"><\/a><\/p><\/li>\n<\/ul>\n\n<h2>\n  \n  \n  <strong>How I Used Algolia Agent Studio<\/strong>\n<\/h2>\n\n<p>I used Algolia Agent Studio to power Deal Agent Forge with fast, contextual, retrieval-backed responses.<\/p>\n\n<p><strong>Data &amp; Indexing<\/strong><\/p>\n\n<p>I built a curated index of <strong>103 tech products<\/strong> covering PC components, drone parts, and solar equipment. Each record contains structured specs, category tags, performance indicators, and contextual metadata  all optimized for retrieval.<\/p>\n\n<p>Users also have a \u201cReport Issue\u201d feature to flag incorrect details. When issues are reported, I update the dataset in Supabase and sync corrections to Algolia, keeping data fresh and reliable.<\/p>\n\n<p>This approach aligns with the retrieval-first ethos: the agent retrieves grounded facts from structured data rather than hallucinating answers, reducing errors and improving usefulness.<\/p>\n\n<p><strong>Conversational Intelligence<\/strong><\/p>\n\n<p>Prompt engineering ensures context awareness: the assistant remembers preferences across exchanges<\/p>\n\n<p>Retrieval ensures responses are up-to-date and data-grounded<\/p>\n\n<p>Integration with <strong>Algolia\u2019s InstantSearch Chat widget<\/strong> creates a smooth frontend experience<\/p>\n\n<p>By combining search-native retrieval and LLM reasoning, the assistant feels like talking to an expert tech consultant powered by real data.<\/p>\n\n<p><strong>Algolia Agent Studio and My Index<\/strong><\/p>\n\n<p><a href=\"https:\/\/media2.dev.to\/dynamic\/image\/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto\/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fec8fwd610vc5mw6v2fml.png\" class=\"article-body-image-wrapper\"><img src=\"https:\/\/media2.dev.to\/dynamic\/image\/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto\/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fec8fwd610vc5mw6v2fml.png\" alt=\"Deal Agent Forge Index\"><\/a><\/p>\n\n<p><a href=\"https:\/\/media2.dev.to\/dynamic\/image\/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto\/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvfbfc0yv5x3kvdbtyxd8.png\" class=\"article-body-image-wrapper\"><img src=\"https:\/\/media2.dev.to\/dynamic\/image\/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto\/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvfbfc0yv5x3kvdbtyxd8.png\" alt=\"Algolia Agent Studio\"><\/a><\/p>\n\n<h3>\n  \n  \n  InstantSearch Chat Integration\n<\/h3>\n\n<p>The frontend uses Algolia's InstantSearch Chat widget with custom styling to match the teal glassmorphism theme:<br>\n<\/p>\n\n<div class=\"highlight js-code-highlight\">\n<pre class=\"highlight jsx\"><code><span class=\"p\">&lt;<\/span><span class=\"nc\">InstantSearch<\/span>\n    <span class=\"na\">searchClient<\/span><span class=\"p\">=<\/span><span class=\"si\">{<\/span><span class=\"nx\">searchClient<\/span><span class=\"si\">}<\/span>\n    <span class=\"na\">indexName<\/span><span class=\"p\">=<\/span><span class=\"s\">\"Deal_Agent_Forge_Data\"<\/span>\n<span class=\"p\">&gt;<\/span>\n    <span class=\"p\">&lt;<\/span><span class=\"nc\">Chat<\/span> <span class=\"na\">agentId<\/span><span class=\"p\">=<\/span><span class=\"si\">{<\/span><span class=\"nx\">agentId<\/span><span class=\"si\">}<\/span> <span class=\"p\">\/&gt;<\/span>\n<span class=\"p\">&lt;\/<\/span><span class=\"nc\">InstantSearch<\/span><span class=\"p\">&gt;<\/span>\n<\/code><\/pre>\n\n<\/div>\n\n\n\n<h2>\n  \n  \n  <strong>Why Fast Retrieval Matters<\/strong>\n<\/h2>\n\n<p>Fast retrieval is the backbone of Deal Agent Forge\u2019s performance and is at the heart of Agent Studio\u2019s design philosophy.<\/p>\n\n<p><strong>Real-World Impact<\/strong><\/p>\n\n<ol>\n<li>\n<strong>Instant Compatibility Checks<\/strong> \u2014 millisecond-level retrieval avoids slow or incorrect replies<\/li>\n<li>\n<strong>Accurate Pricing &amp; Specs<\/strong> \u2014 no stale or hallucinated answers<\/li>\n<li>\n<strong>Smooth Conversations<\/strong> \u2014 users never experience lag while the agent fetches context<\/li>\n<li>\n<strong>Better Decisions<\/strong> \u2014 structured data retrieval leads to precise recommendations<\/li>\n<\/ol>\n\n<p>This matches the evolving trend in industry \u2014 retrieval-first architecture \u2014 where agents rely on structured search systems to reduce hallucination, control costs, and improve quality rather than depending solely on generative output.<\/p>\n\n<h2>\n  \n  \n  <strong>Technical Architecture<\/strong>\n<\/h2>\n\n<p><strong>Frontend:<\/strong><\/p>\n\n<p>React 19 + Vite<br>\nInstantSearch Chat widget for conversation UI<br>\nThree.js for 3D previews<br>\nTailwindCSS for design coherence<\/p>\n\n<p><strong>Backend:<\/strong><\/p>\n\n<p><strong>Supabase for database management<\/strong><\/p>\n\n<p>Algolia for fast retrieval and conversational grounding<br>\nContinuous sync between Supabase and Algolia for real-time updates<br>\nIndexing &amp; Retrieval:<\/p>\n\n<p><strong>Semantic and structured indexing<\/strong><\/p>\n\n<p>Hybrid relevance: specs, tags, categories, price, compatibility<br>\nContextual prompt routing to Algolia data<\/p>\n\n<h2>\n  \n  \n  <strong>Final Impact<\/strong>\n<\/h2>\n\n<p>Deal Agent Forge turns the complex process of tech configuration into a guided, interactive, data-driven experience \u2014 removing guesswork and replacing it with contextual, accurate assistance.<\/p>\n\n<p>It demonstrates how Agent Studio + retrieval-centered data architecture enables highly practical conversational agents with real utility beyond demos, aligning with the latest trends in AI agent design.<\/p>\n\n","category":["devchallenge","algoliachallenge","ai","agents"]},{"title":"Boosting Goose Performance on Windows \u2014 Real Benchmarks, Power Tweaks, and Results","pubDate":"Wed, 29 Oct 2025 17:06:26 +0000","link":"https:\/\/dev.to\/mohammed_thaha\/boosting-goose-performance-on-windows-real-benchmarks-power-tweaks-and-results-54gf","guid":"https:\/\/dev.to\/mohammed_thaha\/boosting-goose-performance-on-windows-real-benchmarks-power-tweaks-and-results-54gf","description":"<p>If you\u2019ve downloaded Goose for Windows and launched it straight from <code>goose.exe<\/code>, you\u2019ve probably noticed it runs smoothly \u2014 until your system starts feeling heavy. Browser tabs, sync apps, and background services all fight for the same CPU and RAM Goose needs to perform well.<\/p>\n\n<p>In this article, I\u2019ll share my <strong>real-world performance optimization journey<\/strong> running Goose on a Windows laptop, including actual PowerShell benchmarks, configuration fixes, and verified results. No deep system hacks \u2014 just practical, reversible tweaks that made Goose run significantly faster and more responsive.<\/p>\n\n\n\n\n<h2>\n  \n  \n  System Overview \u2014 The Starting Point\n<\/h2>\n\n<p>Before tuning anything, I gathered raw system data to understand what was slowing Goose down. Here\u2019s the baseline snapshot captured via PowerShell and Task Manager:<\/p>\n\n<p><strong>Top Processes by CPU Usage<\/strong><\/p>\n\n<ul>\n<li>OneDrive \u2014 1118.29s CPU time<\/li>\n<li>Explorer \u2014 327.04s<\/li>\n<li>Chrome \u2014 54.87s (388 MB RAM usage)<\/li>\n<\/ul>\n\n<p><strong>Memory Stats<\/strong><\/p>\n\n<ul>\n<li>Total Physical Memory: 8 GB<\/li>\n<li>Free Memory before optimization: ~1.02 GB<\/li>\n<li>Active Power Plan: Balanced (default mode)<\/li>\n<\/ul>\n\n<p><strong>Interpretation:<\/strong><br>\nThe system was clearly under resource pressure. OneDrive and Chrome alone were consuming over half of the available CPU cycles and memory. The \u201cBalanced\u201d power plan was also holding back CPU clock speeds \u2014 a subtle but real performance bottleneck.<\/p>\n\n\n<h2>\n  \n  \n  Step 1 \u2014 Switching to High Performance Mode\n<\/h2>\n\n<p>Windows ships with a \u201cHigh Performance\u201d plan that minimizes CPU throttling and keeps the processor active for heavy workloads. By default, most systems stay on \u201cBalanced,\u201d which reduces speed to save power.<\/p>\n\n<p>To enable High Performance, I ran:<br>\n<\/p>\n\n<div class=\"highlight js-code-highlight\">\n<pre class=\"highlight plaintext\"><code>powercfg \/list\n<\/code><\/pre>\n\n<\/div>\n\n\n\n<p>Then activated it using the GUID shown for the High Performance plan:<br>\n<\/p>\n\n<div class=\"highlight js-code-highlight\">\n<pre class=\"highlight plaintext\"><code>powercfg \/setactive SCHEME_BALANCED\n<\/code><\/pre>\n\n<\/div>\n\n\n\n<p><strong>Result:<\/strong><br>\nAfter applying this, CPU responsiveness noticeably improved. Goose tasks launched faster, and background lag during AI or heavy workloads dropped by about 20\u201325% in practical feel.<\/p>\n\n\n<h2>\n  \n  \n  Step 2 \u2014 Launching Goose at High Priority\n<\/h2>\n\n<p>Next, I made sure Windows gave Goose more CPU scheduling priority. The old PowerShell flag <code>-Priority<\/code> no longer works, so the correct modern way is:<br>\n<\/p>\n\n<div class=\"highlight js-code-highlight\">\n<pre class=\"highlight plaintext\"><code>Start-Process \"C:\\goose_application\\dist-windows\\goose.exe\"\nGet-Process goose | ForEach-Object { $_.PriorityClass = 'High' }\n<\/code><\/pre>\n\n<\/div>\n\n\n\n<p><strong>Result:<\/strong><br>\nThis ensured Goose ran smoothly even when other apps like Chrome or VS Code were open. Task Manager confirmed its priority was successfully elevated. The app felt much more responsive \u2014 especially noticeable when interacting with models or rendering outputs.<\/p>\n\n\n<h2>\n  \n  \n  Step 3 \u2014 Freeing System Resources\n<\/h2>\n\n<p>One of the biggest slowdowns came from background services and sync apps.<br>\nHere\u2019s what I did for quick and safe improvement:<\/p>\n\n<ul>\n<li>Paused OneDrive syncing.<\/li>\n<li>Closed Chrome tabs and other heavy browsers.<\/li>\n<li>Stopped unnecessary background apps through Task Manager.<\/li>\n<li>Cleaned temporary files and freed disk space.<\/li>\n<\/ul>\n\n<p>After cleanup, <strong>free memory increased from ~1.02 GB to 3.4 GB<\/strong> \u2014 a huge improvement for an 8 GB system.<\/p>\n\n\n<h2>\n  \n  \n  Step 4 \u2014 Rerunning Benchmarks After Optimization\n<\/h2>\n\n<p>After applying all the changes:<\/p>\n\n<ol>\n<li><strong>High Performance power plan activated<\/strong><\/li>\n<li><strong>Goose launched at High priority<\/strong><\/li>\n<li><strong>Background apps closed<\/strong><\/li>\n<li><strong>Focus Assist enabled to reduce notifications<\/strong><\/li>\n<\/ol>\n\n<p>I rechecked performance and memory usage via PowerShell and Task Manager.<\/p>\n\n<p><strong>After Optimization Snapshot<\/strong><\/p>\n\n<ul>\n<li>Free Physical Memory: ~3.4 GB (vs 1.02 GB before)<\/li>\n<li>OneDrive CPU usage dropped to negligible (paused)<\/li>\n<li>Explorer and Chrome usage stabilized below 10% CPU<\/li>\n<li>Goose process stayed active and snappy throughout session<\/li>\n<\/ul>\n\n<p><strong>Subjective Performance:<\/strong><br>\nGoose now launched 2\u00d7 faster and maintained consistent responsiveness under load. File operations, log access, and UI rendering were visibly smoother.<\/p>\n\n\n<h2>\n  \n  \n  \ud83d\udcc1 Folder Organization Optimization\n<\/h2>\n\n<p>To prevent unnecessary scans and conflicts, I organized the Goose files neatly:<br>\n<\/p>\n\n<div class=\"highlight js-code-highlight\">\n<pre class=\"highlight plaintext\"><code>C:\\goose_application\n\u2514\u2500 dist-windows\n   \u2514\u2500 goose.exe\n<\/code><\/pre>\n\n<\/div>\n\n\n\n\n\n\n<h2>\n  \n  \n  \ud83d\udcca Before vs After Summary\n<\/h2>\n\n<div class=\"table-wrapper-paragraph\"><table>\n<thead>\n<tr>\n<th>Metric<\/th>\n<th>Before<\/th>\n<th>After<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Free Physical Memory<\/td>\n<td>~1.02 GB<\/td>\n<td>~3.4 GB<\/td>\n<\/tr>\n<tr>\n<td>Power Plan<\/td>\n<td>Balanced<\/td>\n<td>High Performance<\/td>\n<\/tr>\n<tr>\n<td>Goose Priority<\/td>\n<td>Normal<\/td>\n<td>High<\/td>\n<\/tr>\n<tr>\n<td>CPU Responsiveness<\/td>\n<td>Moderate<\/td>\n<td>Instantaneous<\/td>\n<\/tr>\n<tr>\n<td>Launch Time<\/td>\n<td>~5s<\/td>\n<td>~2.3s<\/td>\n<\/tr>\n<tr>\n<td>Background CPU Load<\/td>\n<td>High (OneDrive + Chrome)<\/td>\n<td>Low (paused OneDrive)<\/td>\n<\/tr>\n<\/tbody>\n<\/table><\/div>\n\n<p><strong>Overall Performance Gain:<\/strong><br>\n\u2248 2\u00d7 faster launch, 20\u201325% smoother runtime, and noticeably lower stutter.<\/p>\n\n\n\n\n<h2>\n  \n  \n  Extra Windows Tips\n<\/h2>\n\n<ul>\n<li>Keep at least 10 GB free space on your system drive.<\/li>\n<li>Restart Windows every few days to clear memory fragmentation.<\/li>\n<\/ul>\n\n\n\n\n<h2>\n  \n  \n  Conclusion \u2014 The Practical Takeaway\n<\/h2>\n\n<p>Goose performance depends less on hardware specs and more on how efficiently Windows allocates resources. By applying these simple yet impactful changes:<\/p>\n\n<ul>\n<li>Switching to High Performance mode<\/li>\n<li>Running Goose at High priority<\/li>\n<li>Closing background apps<\/li>\n<li>Keeping folder organization clean<\/li>\n<\/ul>\n\n<p>you can make Goose feel significantly faster and smoother \u2014 even on a modest 8 GB laptop.<\/p>\n\n<p>After all, a happy Goose is a fast Goose. \ud83e\udd86\u26a1<\/p>\n\n<p>\ud83e\udeb6This blog is based on my personal understanding and hands-on benchmarks tested on my own Windows setup.<\/p>\n\n","category":["performance","tooling","tutorial","hacktoberfest"]},{"title":"Building an STL-Based Tic-Tac-Toe Game for CP Solvers in C++","pubDate":"Tue, 12 Aug 2025 10:20:45 +0000","link":"https:\/\/dev.to\/mohammed_thaha\/building-an-stl-based-tic-tac-toe-game-for-cp-solvers-in-c-ikc","guid":"https:\/\/dev.to\/mohammed_thaha\/building-an-stl-based-tic-tac-toe-game-for-cp-solvers-in-c-ikc","description":"<p>Competitive Programming (CP) is all about solving problems efficiently, and sometimes small projects like Tic-Tac-Toe can be a great way to sharpen your problem-solving mindset.<br>\nIn this post, we\u2019ll build a Tic-Tac-Toe game in C++ using STL (vector) and basic control flow \u2014 perfect for beginners in CP who want to brush up their coding fundamentals.<\/p>\n\n<p><strong>Why This is Useful for CP<\/strong><\/p>\n\n<ol>\n<li>STL Practice: Using vector for dynamic data handling<\/li>\n<li>Logic Building: Win condition checks are similar to pattern-finding problems in CP<\/li>\n<li>Input Validation: Good practice for handling constraints and edge cases<\/li>\n<li>Fast Iteration: The game loop teaches efficient looping patterns<\/li>\n<\/ol>\n\n<p><strong>Step 1 \u2014 Representing the Board with STL<\/strong><\/p>\n\n<p><a href=\"https:\/\/media2.dev.to\/dynamic\/image\/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto\/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgl8ovatb5gf78b7t3ma9.png\" class=\"article-body-image-wrapper\"><img src=\"https:\/\/media2.dev.to\/dynamic\/image\/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto\/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgl8ovatb5gf78b7t3ma9.png\" alt=\"step1\" width=\"688\" height=\"696\"><\/a><\/p>\n\n<ul>\n<li>board stores the game state<\/li>\n<li>currentPlayer keeps track of whose turn it is<\/li>\n<li>isTie checks if the match ends in a draw<\/li>\n<\/ul>\n\n<p><strong>Step 2 \u2014 Printing the Board<\/strong><\/p>\n\n<p>We\u2019ll create a clean, grid-like display for our board.<\/p>\n\n<p><a href=\"https:\/\/media2.dev.to\/dynamic\/image\/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto\/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Feawrclwvw6p9fet8cdpa.png\" class=\"article-body-image-wrapper\"><img src=\"https:\/\/media2.dev.to\/dynamic\/image\/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto\/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Feawrclwvw6p9fet8cdpa.png\" alt=\"step2\" width=\"800\" height=\"264\"><\/a><\/p>\n\n<p><strong>Step 3 \u2014 Player Moves with Validation<\/strong><\/p>\n\n<p>In CP, validating input is crucial. We\u2019ll reject invalid moves and recursively retry.<\/p>\n\n<p><a href=\"https:\/\/media2.dev.to\/dynamic\/image\/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto\/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy974d4qjja09k4b701w3.png\" class=\"article-body-image-wrapper\"><img src=\"https:\/\/media2.dev.to\/dynamic\/image\/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto\/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy974d4qjja09k4b701w3.png\" alt=\"step3\" width=\"800\" height=\"461\"><\/a><\/p>\n\n<p><strong>Step 4 \u2014 Win &amp; Tie Check Logic<\/strong><\/p>\n\n<p>We\u2019ll check rows, columns, and diagonals.<br>\nThis pattern-checking logic is directly applicable to CP problems involving matrices.<\/p>\n\n<p><a href=\"https:\/\/media2.dev.to\/dynamic\/image\/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto\/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh504kp24ky8utmnxxbsm.png\" class=\"article-body-image-wrapper\"><img src=\"https:\/\/media2.dev.to\/dynamic\/image\/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto\/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh504kp24ky8utmnxxbsm.png\" alt=\"step4\" width=\"800\" height=\"556\"><\/a><\/p>\n\n<p><strong>Step 5 \u2014 Main Function<\/strong><br>\nWe bring everything together in the game loop.<\/p>\n\n<p><a href=\"https:\/\/media2.dev.to\/dynamic\/image\/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto\/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjoztxmr3l2niatk690fb.png\" class=\"article-body-image-wrapper\"><img src=\"https:\/\/media2.dev.to\/dynamic\/image\/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto\/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjoztxmr3l2niatk690fb.png\" alt=\"step5\" width=\"800\" height=\"455\"><\/a><\/p>\n\n<p><strong>Output<\/strong><br>\n<\/p>\n\n<div class=\"highlight js-code-highlight\">\n<pre class=\"highlight plaintext\"><code>Welcome to Tic-Tac-Toe!\n\n 1 | 2 | 3\n---|---|---\n 4 | 5 | 6\n---|---|---\n 7 | 8 | 9\n\nPlayer 'X', enter your move (1-9): 1\n\n X | 2 | 3\n---|---|---\n 4 | 5 | 6\n---|---|---\n 7 | 8 | 9\n\n<\/code><\/pre>\n\n<\/div>\n\n\n\n<p>\u2026and so on until the game ends.<\/p>\n\n<p>\ud83d\udd17 <strong>Source Code on GitHub:<\/strong> <a href=\"https:\/\/github.com\/Mohammed-Thaha\/STL-Based-Tic-Tac-Toe-Game\" rel=\"noopener noreferrer\">View Here<\/a><\/p>\n\n<p><strong>Conclusion:<\/strong> This STL-powered Tic-Tac-Toe in C++ blends fun with fundamentals \u2014 vectors, loops, and logic checks \u2014 making it a quick win for CP practice. Clone it, tweak it, and try larger board variations for an extra challenge.<\/p>\n\n","category":["cpp","stl","gamechallenge","gamedev"]}]}}