{
    "last_hit": "2026-11-07 03:13:40",
    "timestamp": 1794021220,
    "/diy/admin_autoposter/autoposter.php": 1,
    "/diy/admin_delivery/process_orders.php": 1
}<br />
<b>Warning</b>:  Cannot modify header information - headers already sent by (output started at /var/www/html/cron_local.php:92) in <b>/var/www/html/includes/auth.php</b> on line <b>215</b><br />
<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Maze Game</title><meta name="description" content="CfCbazar offers DIY eGuides for cooking, budgeting, survival planning, electronics, PCB projects, open-source tools, smart deals, free browser games, music &amp; TV entertainment. Discover practical digital tools made to save you time and money."><meta name="robots" content="index, follow"><meta name="author" content="CfCbazar"><link rel="canonical" href="https://cfcbazar.cloud-ip.cc/games/maze/"><meta property="og:site_name" content="CfCbazar"><meta property="og:title" content="Maze Game"><meta property="og:description" content="CfCbazar offers DIY eGuides for cooking, budgeting, survival planning, electronics, PCB projects, open-source tools, smart deals, free browser games, music &amp; TV entertainment. Discover practical digital tools made to save you time and money."><meta property="og:type" content="website"><meta property="og:url" content="https://cfcbazar.cloud-ip.cc/games/maze/"><meta property="og:image" content="https://cfcbazar.cloud-ip.cc/assets/images/cfcbazar-banner.jpg"><meta name="twitter:card" content="summary_large_image"><meta name="twitter:title" content="Maze Game"><meta name="twitter:description" content="CfCbazar offers DIY eGuides for cooking, budgeting, survival planning, electronics, PCB projects, open-source tools, smart deals, free browser games, music &amp; TV entertainment. Discover practical digital tools made to save you time and money."><meta name="twitter:url" content="https://cfcbazar.cloud-ip.cc/games/maze/"><meta name="twitter:image" content="https://cfcbazar.cloud-ip.cc/assets/images/cfcbazar-banner.jpg"><link rel="stylesheet" href="/assets/css/styles.css"><script src="https://cdn.jsdelivr.net/npm/chart.js"></script><script src="https://cdn.jsdelivr.net/npm/qrious@4.0.2/dist/qrious.min.js"></script></head><body><header class="header"></header><nav class="main-nav"><button class="menu-toggle" aria-expanded="false" aria-label="Toggle navigation">☰ Menu</button><ul class="nav-menu"><li><a href="/index.php">🏠 Home</a></li><li><a href="https://www.facebook.com/groups/195994786555718/">🔗 Smart Deals</a></li><li><a href="/diy/index.php">🔧 DIY Tools</a></li><li><a href="/games/index.php">🎮 Games</a></li><li><a href="https://youtube.com/playlist?list=PLY4e42xsZig5Yu7GZ6VN1OSn-0cy90yJu">🎵 Music</a></li><li><a href="https://ebay.us/m/DM1tRs">🚚 Visit Store</a></li><li><a href="/profile.php">🧑‍💻 Profile</a></li><li><a href="/help/">❓ Help Center</a></li><li><a href="/about.php">ℹ️ About Us</a></li><li><a href="/t.php">📜 Terms &amp; Privacy</a></li><li><a href="/c.php">🍪 Cookies</a></li><li><a href="/login.php">🔑 Sign In / Register</a></li></ul></nav><div id="advertPopup" style="display:none; position:fixed; bottom:20px; right:20px; width:300px; background:#fff; border:1px solid #ccc; box-shadow:0 0 10px rgba(0,0,0,0.3); padding:15px; z-index:9999;">
    <span style="float:right; cursor:pointer;" onclick="document.getElementById('advertPopup').style.display='none';">✖</span>
    <strong>🔥 Contact:</strong><br>
    <a href="/contact.php" target="_blank" style="color:#0077cc; text-decoration:underline;">
        Click here to report en error/feature!
    </a>
</div>
<script>
    setTimeout(function() {
        if (document.getElementById('advertPopup')) document.getElementById('advertPopup').style.display = 'block';
    }, 3000);
</script><div id="cfc-adbar-ea402f" class="cfc-adbar" style="position:static;top:75px;left:0;right:0;background:#111;color:#fff;padding:14px 16px;z-index:100;border-bottom:1px solid rgba(255,255,255,.1);box-sizing:border-box;font-size:18px;text-align:center;overflow:hidden;min-height:56px;line-height:28px;display:flex;align-items:center;justify-content:center;"><a class="cfc-ad-item" href="https://ebay.us/m/DM1tRs" target="_blank" rel="noopener" style="display:inline;color:#fff;text-decoration:none;font-weight:600;">🛒 Smart Deals on eBay</a><a class="cfc-ad-item" href="/diy/" target="_blank" rel="noopener" style="display:none;color:#fff;text-decoration:none;font-weight:600;">🛠️ Free DIY Tools &amp; Guides</a><a class="cfc-ad-item" href="/games/" target="_blank" rel="noopener" style="display:none;color:#fff;text-decoration:none;font-weight:600;">🎮 Play Games &amp; Earn Tokens</a><a class="cfc-ad-item" href="https://www.youtube.com/@cfcbazar/playlists" target="_blank" rel="noopener" style="display:none;color:#fff;text-decoration:none;font-weight:600;">📺 Free TV &amp; Entertainment</a><a class="cfc-ad-item" href="https://www.facebook.com/groups/" target="_blank" rel="noopener" style="display:none;color:#fff;text-decoration:none;font-weight:600;">📢 Join Smart Deals Facebook Group</a></div><script>
(function(){
  var bar = document.getElementById('cfc-adbar-ea402f');
  if (!bar) return;
  var items = bar.querySelectorAll('.cfc-ad-item');
  if (items.length < 2) return;
  var idx = 0;
  setInterval(function(){
    items[idx].style.display = 'none';
    idx = (idx + 1) % items.length;
    items[idx].style.display = 'inline';
  }, 4000);
})();
</script>
<style>
  /* Scoped to not break the main site */
  .maze-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #111;
    color: white;
    font-family: sans-serif;
    padding: 20px 0;
    min-height: calc(100dvh - 150px); /* Adjust based on your header/footer height */
    margin: 0 auto;
    max-width: 800px;
  }

  #header-maze {
    display: flex; justify-content: center; align-items: center;
    padding: 10px; font-size: 1.2rem;
    background: #000; width: 100%; box-sizing: border-box;
  }

  #maze {
    display: grid;
    grid-template-columns: repeat(11, 1fr);
    gap: 1px;
    width: 95vw;
    max-width: 400px; /* Prevents it from getting too large on desktop */
    aspect-ratio: 1 / 1;
    margin: 20px auto;
  }

  .cell {
    background: #333;
    width: 100%;
    height: 100%;
    display: flex; align-items: center; justify-content: center;
  }
  .wall { background: #555; }

  .controls {
    display: flex; flex-direction: column;
    justify-content: center; align-items: center;
    gap: 15px; margin-bottom: 20px;
  }

  .button-row {
    display: flex; justify-content: center;
    flex-wrap: wrap; gap: 10px;
  }

  .arrow-btn {
    font-size: 1.5rem;
    width: 60px; height: 60px;
    background: #222; color: white;
    border: 1px solid #444; border-radius: 10px;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    cursor: pointer;
  }
  .arrow-btn:active { background: #0077cc; }

  .arrow-btn span.label { font-size: 0.8rem; margin-top: 4px; }

  .arrow-btn svg { width: 24px; height: 24px; flex-shrink: 0; }
</style>

<div class="maze-wrapper">
  <div id="header-maze">
    Moves: <span id="moves" style="margin-left: 8px;">0</span>
  </div>

  <div id="maze"></div>

  <div class="controls">
    <div class="button-row">
      <button class="arrow-btn" onclick="move(0,-1)">
        <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round">
          <path d="M12 19V5M5 12l7-7 7 7"/>
        </svg>
        <span class="label">Up</span>
      </button>
      <button class="arrow-btn" onclick="move(-1,0)">
        <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round">
          <path d="M19 12H5M12 19l-7-7 7-7"/>
        </svg>
        <span class="label">Left</span>
      </button>
      <button class="arrow-btn" onclick="move(1,0)">
        <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round">
          <path d="M5 12h14M12 5l7 7-7 7"/>
        </svg>
        <span class="label">Right</span>
      </button>
      <button class="arrow-btn" onclick="move(0,1)">
        <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round">
          <path d="M12 5v14M19 12l-7 7-7-7"/>
        </svg>
        <span class="label">Down</span>
      </button>
    </div>
  </div>
</div>

<script>
  const width = 11, height = 11;
  const maze = Array(width*height).fill(1);
  const playerPos = { x:0, y:0 };
  const goalPos   = { x:width-1, y:height-1 };
  let moves = 0;

  const mazeDiv     = document.getElementById('maze');
  const moveCounter = document.getElementById('moves');

  function index(x,y){ return y*width + x; }

  function generateMaze(){
    const visited = Array(width*height).fill(false);
    function shuffle(a){
      for(let i=a.length-1;i>0;i--){
        const j = Math.floor(Math.random()*(i+1));
        [a[i],a[j]]=[a[j],a[i]];
      }
      return a;
    }
    function carve(x,y){
      visited[index(x,y)] = true;
      maze[index(x,y)] = 0;
      for(const [dx,dy] of shuffle([[0,-2],[2,0],[0,2],[-2,0]])){
        const nx=x+dx, ny=y+dy;
        if(nx>=0&&ny>=0&&nx<width&&ny<height&&!visited[index(nx,ny)]){
          maze[index(x+dx/2,y+dy/2)] = 0;
          carve(nx,ny);
        }
      }
    }
    carve(0,0);
  }

  function drawMaze(){
    mazeDiv.innerHTML='';
    for(let y=0;y<height;y++){
      for(let x=0;x<width;x++){
        const div = document.createElement('div');
        div.className = 'cell';

        if(maze[index(x,y)]===1){
          div.classList.add('wall');
        } else if(x===playerPos.x && y===playerPos.y){
          div.classList.add('player');
          div.innerHTML = `<svg viewBox="0 0 24 24" fill="none" stroke="#32CD32" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" width="60%" height="60%">
                              <circle cx="12" cy="7" r="4"/>
                              <path d="M5.5 21a8.38 8.38 0 0113 0"/>
                           </svg>`;
        } else if(x===goalPos.x && y===goalPos.y){
          div.classList.add('goal');
          div.innerHTML = `<svg viewBox="0 0 24 24" fill="none" stroke="#FFD700" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" width="60%" height="60%">
                              <rect x="3" y="3" width="18" height="18" rx="2" ry="2"/>
                              <path d="M8 21V7h8v14"/>
                              <circle cx="12" cy="15" r="1"/>
                           </svg>`;
        }
        mazeDiv.appendChild(div);
      }
    }
  }

  function move(dx,dy){
    const nx = playerPos.x+dx, ny = playerPos.y+dy;
    if(nx>=0&&ny>=0&&nx<width&& ny<height && maze[index(nx,ny)]===0){
      playerPos.x = nx;
      playerPos.y = ny;
      moves++;
      moveCounter.textContent = moves;
      drawMaze();

      if(nx === goalPos.x && ny === goalPos.y){
        setTimeout(() => {
          alert(`🎉 You escaped the maze in ${moves} moves!`);
        }, 150);
      }
    }
  }

  document.addEventListener('keydown', e => {
    // Prevent page scrolling when using arrow keys
    if (['ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight'].includes(e.key)) {
        e.preventDefault(); 
    }
    if (e.key === 'ArrowUp')    move(0, -1);
    if (e.key === 'ArrowDown')  move(0, 1);
    if (e.key === 'ArrowLeft')  move(-1, 0);
    if (e.key === 'ArrowRight') move(1, 0);
  });

  generateMaze();
  drawMaze();
</script>

<footer class="footer">
    <div class="card" style="padding:25px; margin-top:40px; text-align:center;">
        <h3 style="font-size:1.8rem; margin-bottom:15px;">GitHub</h3>
        <p style="font-size:1.2rem; margin-bottom:20px;">
            View the full source code for this page on GitHub.
        </p>
        <a href="https://github.com/ArakelTheDragon/CfCbazar_WebDev/tree/main/games/maze.php" target="_blank" rel="noopener noreferrer" style="display:inline-block; padding:15px 25px; font-size:1.3rem; font-weight:bold; background:linear-gradient(135deg,#28a745,#1e7e34); color:#fff; border-radius:10px; text-decoration:none;">
            Maze Game Source Code &rarr;
        </a>
    </div>
</footer><footer class="footer" style="padding:1em; background:#f8f8f8; text-align:center; font-size:0.95em;"><p>&copy; CfCbazar. All rights reserved.</p><p><a href="/t.php">Privacy Policy</a> | <a href="/t.php">Terms</a></p><p style="margin-top:1em;">📢 Follow us for official updates:</p><ul class="social-links" style="list-style:none; padding:0; margin:0; display:flex; flex-wrap:wrap; justify-content:center; gap:0.5em;"><li><a href="https://x.com/workthrp" target="_blank" rel="noopener">🐦 WorkToken on X</a></li><li><a href="https://x.com/cfcbazargroup" target="_blank" rel="noopener">🐦 CfCbazar Group on X</a></li><li><a href="https://www.facebook.com/share/12J6NS1M2cY/" target="_blank" rel="noopener">📘 WorkToken on Facebook</a></li><li><a href="https://www.facebook.com/share/1CshFfT6bG/" target="_blank" rel="noopener">📘 CfCbazar on Facebook</a></li><li><a href="https://youtube.com/@worktoken?si=PtWNenpqAYYadD0V" target="_blank" rel="noopener">📺 WorkToken on YouTube</a></li><li><a href="https://youtube.com/@cfcbazar?si=LkDTc8EPU1vr9MNR" target="_blank" rel="noopener">📺 CfCbazar on YouTube</a></li><li><a href="https://www.tiktok.com/@worktoken?_t=ZN-90uYlCvmRks&_r=1" target="_blank" rel="noopener">🎵 WorkToken on TikTok</a></li><li><a href="https://www.tiktok.com/@cfcbazar?_t=ZN-90uYo1jYz4A&_r=1" target="_blank" rel="noopener">🎵 CfCbazar on TikTok</a></li><li><a href="https://github.com/ArakelTheDragon/CfCbazar-Tokens" target="_blank" rel="noopener">🧠 CfCbazar-Tokens on GitHub</a></li><li><a href="https://pancakeswap.finance/swap?inputCurrency=0xecbD4E86EE8583c8681E2eE2644FC778848B237D&outputCurrency=0xffc4f8Bde970D87f324AefB584961DDB0fbb4F00" target="_blank" rel="noopener">💱 Trade WorkTHR/WTK on PancakeSwap</a></li></ul><p style="margin-top:1em;">📬 Contact us: <a href="mailto:cfcbazar@gmail.com">cfcbazar@gmail.com</a></p></footer><script src="/assets/js/scripts.js" defer></script><script>
        document.addEventListener("DOMContentLoaded", () => {
            const menu = document.querySelector(".main-nav");
            if (menu) {
                document.documentElement.style.setProperty("--menu-height", menu.offsetHeight + "px");
            }
        });
        </script></body></html>