Use this interactive Maze and Rat Game (Maze and Rat Game) to practice
maze-based logic questions commonly asked in the Accenture Gaming Round.
This game helps you understand the pattern, improve accuracy, and gain confidence before the exam.
/* — CORE STYLES — */
#velocity-game-wrapper {
font-family: ‘Segoe UI’, Tahoma, Verdana, sans-serif;
background-color: black;
color: #fff;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 10px;
border-radius: 10px;
user-select: none;
margin: 0 auto;
max-width: 600px;
min-height: 500px;
position: relative;
width: 100%;
box-sizing: border-box;
}
/* — SEPARATE SECTIONS (CARDS) — */
.v-section-card {
background: #2d2d2d;
width: 100%;
padding: 25px;
border-radius: 15px;
box-shadow: 0 5px 15px rgba(0,0,0,0.3);
margin-bottom: 20px; /* Space between sections */
text-align: center;
box-sizing: border-box;
border: 1px solid #444;
}
/* START SCREEN WRAPPER */
#v-start-screen {
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
z-index: 200;
}
#v-start-screen h1 {
font-size: 2.2em;
color: #00d2ff;
margin-bottom: 10px;
text-transform: uppercase;
letter-spacing: 3px;
line-height: 1.2;
}
#v-start-screen p {
font-size: 1em;
color: #ccc;
margin-bottom: 20px;
line-height: 1.5;
}
.v-start-btn {
padding: 15px 40px;
font-size: 1.2em;
font-weight: bold;
color: #1a1a1a;
background: #00ff6a;
border: none;
border-radius: 50px;
cursor: pointer;
transition: transform 0.2s, box-shadow 0.2s;
box-shadow: 0 0 15px rgba(0,255,106, 0.4);
width: 100%;
max-width: 250px;
}
.v-start-btn:hover {
transform: scale(1.05);
box-shadow: 0 0 25px rgba(0,255,106, 0.6);
}
/* — WHATSAPP STYLES — */
.wa-title {
font-size: 1.1em;
margin-bottom: 15px;
color: #fff;
font-weight: normal;
}
.blink-btn {
background: #e53935; /* Red color */
border-radius: 5px;
color: white;
display: inline-block;
font-weight: 700;
padding: 12px 24px;
text-decoration: none;
font-size: 16px;
animation: blink-animation 1s infinite alternate;
box-shadow: 0 4px 10px rgba(229, 57, 53, 0.4);
}
@keyframes blink-animation {
0% {
opacity: 1;
}
100% {
opacity: 0.3;
}
}
/* — VIDEO STYLES — */
.video-responsive {
overflow: hidden;
padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
position: relative;
height: 0;
width: 100%;
border-radius: 8px;
border: 2px solid #444;
}
.video-responsive iframe {
left: 0;
top: 0;
height: 100%;
width: 100%;
position: absolute;
}
/* — GAME INTERFACE — */
#v-game-interface {
display: none;
flex-direction: column;
align-items: center;
width: 100%;
}
.wa-titles h3 {
color: #ffffff;
font-weight: 600;
letter-spacing: 0.5px;
}
#velocity-game-wrapper h1.game-title {
margin: 0 0 15px 0;
font-weight: 300;
letter-spacing: 2px;
color: #fff;
text-align: center;
font-size: 24px;
}
.v-header-info {
display: flex;
align-items: center;
justify-content: space-between;
width: 100%;
max-width: 350px;
margin-bottom: 15px;
}
.v-level-tag { font-size: 1.1em; color: #00d2ff; font-weight: bold; }
.v-timer-tag {
font-size: 2em;
color: #fff;
font-weight: bold;
font-family: monospace;
text-shadow: 0 2px 5px rgba(0,0,0,0.5);
}
.v-status-bar {
margin-bottom: 15px;
color: #aaa;
min-height: 1.5em;
text-align: center;
font-size: 14px;
}
.v-game-container {
background: #2d2d2d;
padding: 15px;
border-radius: 15px;
box-shadow: 0 10px 30px rgba(0,0,0,.5);
display: flex;
flex-direction: column;
align-items: center;
position: relative;
width: 100%;
box-sizing: border-box;
}
.v-board-wrapper {
display: flex;
align-items: center;
gap: 5px;
margin-bottom: 20px;
position: relative;
justify-content: center;
}
.v-side-column { display: grid; gap: 5px; height: 100%; }
.v-side-cell {
width: 30px;
height: 70px;
display: flex; align-items: center; justify-content: center;
font-size: 24px;
}
.v-grid {
display: grid; gap: 5px; padding: 5px;
background: #000; border-radius: 8px;
position: relative;
}
.v-cell {
width: 70px; height: 70px;
background: #222; border: 2px solid #444;
border-radius: 4px; cursor: pointer;
overflow: hidden; position: relative;
box-sizing: border-box;
}
.v-cell.selected {
border-color: #00d2ff;
box-shadow: 0 0 15px #00d2ff;
z-index: 10;
}
.v-rotator {
width: 100%; height: 100%;
transition: transform .3s cubic-bezier(.34,1.56,.64,1);
pointer-events: none;
}
.v-tile-svg { width: 100%; height: 100%; display: block; }
#v-projectile {
position: absolute;
width: 40px; height: 40px;
font-size: 30px;
display: flex; align-items: center; justify-content: center;
z-index: 100; pointer-events: none;
transition: all 0.3s linear; opacity: 0;
filter: drop-shadow(0 0 10px #00d2ff);
left: 0; top: 0;
}
.v-controls {
display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; width: 100%;
}
.v-btn-control {
flex: 1;
min-width: 80px;
max-width: 120px;
height: 45px;
border: none; border-radius: 10px;
background: #444; color: #fff;
cursor: pointer; display: flex;
align-items: center; justify-content: center;
box-shadow: 0 4px 0 #222;
font-weight: bold; font-size: 14px;
}
.v-btn-control:active { transform: translateY(4px); box-shadow: none; }
/* MOBILE RESPONSIVE */
@media (max-width: 480px) {
.v-cell { width: 45px; height: 45px; }
.v-side-cell { width: 25px; height: 45px; font-size: 20px; }
#v-projectile { width: 30px; height: 30px; font-size: 20px; }
#v-start-screen h1 { font-size: 1.8em; }
.v-start-btn { padding: 12px 30px; font-size: 1em; }
.v-section-card { padding: 15px; }
}
Practice Maze & Rat Game
Rotate tiles to build a path.
Guide the Rocket 🚀 to Earth 🌍
5 Minutes per level.
Reference Video:
Maze & Rat
(function() {
// Constants
const TYPE = {STRAIGHT:’straight’, CORNER:’corner’, T:’t_junction’, CROSS:’cross’};
const TILE_TYPES = [TYPE.STRAIGHT, TYPE.CORNER, TYPE.T, TYPE.CROSS];
// State
let gridState = [];
let selectedIndex = -1;
let currentLevel = 1;
const MAX_LEVELS = 5;
let COLS = 3, ROWS = 3;
let START_INDEX = 0, END_INDEX = 0;
let IS_ANIMATING = false;
// Timer State
let timerInterval = null;
let timeLeft = 300;
// — START BUTTON LOGIC —
window.vStartSession = function() {
document.getElementById(‘v-start-screen’).style.display = ‘none’;
document.getElementById(‘v-game-interface’).style.display = ‘flex’;
vStartGame(1);
}
// — Initialization —
function vStartGame(level) {
currentLevel = level;
document.getElementById(‘v-level-display’).textContent = `Level ${currentLevel} / ${MAX_LEVELS}`;
const s = document.getElementById(‘v-status’);
s.textContent = “Set the path, then launch 🚀”;
s.style.color = “#aaa”;
// Reset projectile
const p = document.getElementById(‘v-projectile’);
p.style.opacity = ‘0’;
p.style.transition = ‘none’;
IS_ANIMATING = false;
// Level Difficulty
if(level === 1) { COLS=3; ROWS=3; }
else if(level === 2) { COLS=3; ROWS=3; }
else if(level === 3) { COLS=4; ROWS=4; }
else if(level === 4) { COLS=4; ROWS=4; }
else if(level === 5) { COLS=5; ROWS=5; }
vGenerateLevel(ROWS, COLS);
vStartTimer();
}
function vStartTimer() {
if(timerInterval) clearInterval(timerInterval);
timeLeft = 300; // 5 Minutes
vUpdateTimerUI();
timerInterval = setInterval(() => {
timeLeft–;
vUpdateTimerUI();
if (timeLeft <= 0) vHandleTimeUp();
}, 1000);
}
function vUpdateTimerUI() {
const minutes = Math.floor(timeLeft / 60);
const seconds = timeLeft % 60;
const minStr = minutes.toString().padStart(2, '0');
const secStr = seconds.toString().padStart(2, '0');
const display = document.getElementById('v-timer-display');
display.textContent = `${minStr}:${secStr}`;
if (timeLeft {
if (currentLevel < MAX_LEVELS) {
vStartGame(currentLevel + 1);
} else {
s.textContent = "🏁 Game Over! (All levels completed)";
s.style.color = "#fff";
}
}, 1500);
}
// — Level Generation —
function vGenerateLevel(rows, cols) {
const gridEl = document.getElementById('v-grid');
const startColEl = document.getElementById('v-col-start');
const endColEl = document.getElementById('v-col-end');
gridEl.style.gridTemplateColumns = `repeat(${cols}, 1fr)`;
startColEl.style.gridTemplateRows = `repeat(${rows}, 1fr)`;
endColEl.style.gridTemplateRows = `repeat(${rows}, 1fr)`;
gridEl.innerHTML = '';
startColEl.innerHTML = '';
endColEl.innerHTML = '';
gridState = [];
let startRow = Math.floor(Math.random() * rows);
let endRow = Math.floor(Math.random() * rows);
START_INDEX = startRow * cols;
END_INDEX = (endRow * cols) + (cols – 1);
// Side Columns
for(let r=0; r<rows; r++){
const sCell = document.createElement('div');
sCell.className = 'v-side-cell';
if(r === startRow) sCell.innerHTML = '🚀';
startColEl.appendChild(sCell);
const eCell = document.createElement('div');
eCell.className = 'v-side-cell';
if(r === endRow) eCell.innerHTML = '🌍';
endColEl.appendChild(eCell);
}
// Path Algorithm
let pathSet = new Set();
let path = [];
let r = startRow;
let c = 0;
let steps = 0;
while(true){
path.push({r, c});
pathSet.add(r*cols + c);
if(c === cols – 1 && r === endRow) break;
let possible = [];
if(c 0) possible.push({r:r-1, c:c});
if(r 0.3) {
if(c < cols-1) pick = {r:r, c:c+1};
else if(r endRow) pick = {r:r-1, c:c};
}
r = pick.r; c = pick.c;
steps++; if(steps > 100) break;
}
// Determine Tiles based on Path
function getDir(from, to) {
if(to.c > from.c) return ‘left’;
if(to.c from.r) return ‘top’;
return ‘bottom’;
}
let pathTiles = new Map();
for(let i=0; i<path.length; i++){
let curr = path[i];
let entry = (i === 0) ? 'left' : getDir(path[i-1], curr);
let exit = (i === path.length – 1) ? 'right' : getDir(curr, path[i+1]);
pathTiles.set(curr.r*cols + curr.c, {entry, exit});
}
function getCompatibleTile(entry, exit){
const isStraight = (entry==='left' && exit==='right') || (entry==='right' && exit==='left') ||
(entry==='top' && exit==='bottom') || (entry==='bottom' && exit==='top');
if(isStraight) {
const opts = [TYPE.STRAIGHT, TYPE.CROSS, TYPE.T];
return opts[Math.floor(Math.random()*opts.length)];
} else {
const opts = [TYPE.CORNER, TYPE.T, TYPE.CROSS];
return opts[Math.floor(Math.random()*opts.length)];
}
}
// Populate Grid
for(let i=0; i 0.5,
mode: 0
});
const cell = document.createElement(‘div’);
cell.className = ‘v-cell’;
cell.id = `v-cell-${i}`;
cell.onclick = () => vSelectCell(i);
const rot = document.createElement(‘div’);
rot.className = ‘v-rotator’;
rot.id = ‘v-rotator-‘ + i;
cell.appendChild(rot);
gridEl.appendChild(cell);
}
vRenderAll();
}
// — Interaction —
window.vSelectCell = function(i){
if(IS_ANIMATING) return;
document.querySelectorAll(‘.v-cell’).forEach(c=>c.classList.remove(‘selected’));
document.getElementById(`v-cell-${i}`).classList.add(‘selected’);
selectedIndex = i;
}
window.vRotateSelected = function(){
if(selectedIndex < 0 || IS_ANIMATING) return;
gridState[selectedIndex].rotation = (gridState[selectedIndex].rotation + 1) % 4;
vRenderAll();
}
window.vFlipSelected = function(){
if(selectedIndex < 0 || IS_ANIMATING) return;
const tile = gridState[selectedIndex];
if(tile.type === TYPE.CROSS || tile.type === TYPE.T){
tile.mode = (tile.mode + 1) % 4;
} else {
tile.flipped = !tile.flipped;
}
vRenderAll();
}
// — Logic: Ports —
function getPorts(tile){
let ports = {top:0,right:0,bottom:0,left:0};
if(tile.type===TYPE.STRAIGHT){
ports = tile.flipped ? {top:1,right:0,bottom:-1,left:0} : {top:-1,right:0,bottom:1,left:0};
}
if(tile.type===TYPE.CORNER){
ports = tile.flipped ? {top:1,right:-1,bottom:0,left:0} : {top:-1,right:1,bottom:0,left:0};
}
if(tile.type===TYPE.T){
if(tile.mode===0) ports={top:-1,right:1,bottom:0,left:0};
if(tile.mode===1) ports={top:1,right:-1,bottom:0,left:0};
if(tile.mode===2) ports={left:-1,right:1,top:0,bottom:0};
if(tile.mode===3) ports={left:1,right:-1,top:0,bottom:0};
}
if(tile.type===TYPE.CROSS){
if(tile.mode===0) ports={top:-1,bottom:1,left:0,right:0};
if(tile.mode===1) ports={top:1,bottom:-1,left:0,right:0};
if(tile.mode===2) ports={top:-1,right:1,bottom:0,left:0};
if(tile.mode===3) ports={top:1,right:-1,bottom:0,left:0};
}
for(let i=0; i<tile.rotation; i++){
ports = {top:ports.left, right:ports.top, bottom:ports.right, left:ports.bottom};
}
return ports;
}
// — Success/Fail —
function vSuccess(){
clearInterval(timerInterval);
const s = document.getElementById('v-status');
if(currentLevel { vStartGame(currentLevel + 1); }, 1500);
} else {
s.textContent = “🏆 MISSION COMPLETE! You conquered the galaxy! 🌍”;
s.style.color = “#ffd700”;
}
}
function vFail(){
const s = document.getElementById(‘v-status’);
s.textContent = “❌ Crash! Rocket reset to start.”;
s.style.color = “#ff3333”;
}
// — Animation & Execution —
window.vLaunchRocket = function() {
if (IS_ANIMATING) return;
IS_ANIMATING = true;
document.getElementById(‘v-status’).textContent = “Launching…”;
document.getElementById(‘v-status’).style.color = “#fff”;
const opposite = { left:’right’, right:’left’, top:’bottom’, bottom:’top’ };
const trace = [];
let currentIdx = START_INDEX;
let crashed = false;
trace.push(currentIdx);
const startPorts = getPorts(gridState[currentIdx]);
if (startPorts.left !== -1) { crashed = true; }
let safety = 0;
while (!crashed && safety < 100) {
safety++;
const ports = getPorts(gridState[currentIdx]);
let exitDir = null;
for (const dir of ['top','right','bottom','left']) {
if (ports[dir] === 1) { exitDir = dir; break; }
}
if (!exitDir) { crashed = true; break; }
let nextIdx = -1;
if (exitDir === 'right') nextIdx = currentIdx + 1;
if (exitDir === 'left') nextIdx = currentIdx – 1;
if (exitDir === 'bottom') nextIdx = currentIdx + COLS;
if (exitDir === 'top') nextIdx = currentIdx – COLS;
if (nextIdx = ROWS * COLS ||
(exitDir === ‘left’ && currentIdx % COLS === 0) ||
(exitDir === ‘right’ && currentIdx % COLS === COLS – 1)) {
crashed = true;
break;
}
const nextPorts = getPorts(gridState[nextIdx]);
const nextEntry = opposite[exitDir];
if (nextPorts[nextEntry] !== -1) {
trace.push(nextIdx);
crashed = true;
break;
}
currentIdx = nextIdx;
trace.push(currentIdx);
if (currentIdx === END_INDEX) {
const endP = getPorts(gridState[END_INDEX]);
if (endP.right === 1) break;
}
}
vAnimateProjectile(trace, crashed);
}
function vAnimateProjectile(pathIndices, crashed) {
const p = document.getElementById(‘v-projectile’);
const board = document.querySelector(‘.v-board-wrapper’);
const boardRect = board.getBoundingClientRect();
p.style.transition = ‘none’;
p.style.opacity = ‘1’;
const getPos = (idx) => {
const cell = document.getElementById(`v-cell-${idx}`);
if (!cell) return {x:0, y:0};
const rect = cell.getBoundingClientRect();
// Relative position calculation based on current board size
return {
x: rect.left – boardRect.left + (rect.width/2) – (p.offsetWidth/2),
y: rect.top – boardRect.top + (rect.height/2) – (p.offsetHeight/2)
};
};
const startPos = getPos(pathIndices[0]);
// Starting slight offset
p.style.left = (startPos.x – 40) + ‘px’;
p.style.top = startPos.y + ‘px’;
void p.offsetWidth;
p.style.transition = ‘all 0.4s linear’;
let step = 0;
setTimeout(() => {
p.style.left = startPos.x + ‘px’;
p.style.top = startPos.y + ‘px’;
}, 50);
function nextStep() {
if (!IS_ANIMATING && timeLeft <= 0) return;
step++;
if (step prevPos.x) angle = 0;
else if(pos.x prevPos.y) angle = 90;
else if(pos.y {
if(timeLeft > 0) {
p.style.transition = ‘none’;
p.style.opacity = ‘0’;
IS_ANIMATING = false;
const s = document.getElementById(‘v-status’);
s.textContent = “Set the path, then launch 🚀”;
s.style.color = “#aaa”;
}
}, 1500);
} else {
const lastIdx = pathIndices[pathIndices.length-1];
const ports = getPorts(gridState[lastIdx]);
if (lastIdx === END_INDEX && ports.right === 1) {
p.style.left = (parseFloat(p.style.left) + 60) + ‘px’;
setTimeout(() => {
vSuccess();
IS_ANIMATING = false;
}, 400);
} else {
vFail();
setTimeout(() => {
if(timeLeft > 0) {
p.style.transition = ‘none’;
p.style.opacity = ‘0’;
IS_ANIMATING = false;
const s = document.getElementById(‘v-status’);
s.textContent = “Set the path, then launch 🚀”;
s.style.color = “#aaa”;
}
}, 1500);
}
}
}
}
// — Render —
function vRenderAll(){
gridState.forEach((t,i)=>{
const r = document.getElementById(‘v-rotator-‘+i);
r.style.transform = `rotate(${t.rotation*90}deg)`;
r.innerHTML = vGetSVG(t);
});
}
function vGetSVG(tile){
const roadW=40, rs=30;
let road=”, arrow=”;
const drawArrow = (x,y,a) =>
`
if(tile.type===TYPE.STRAIGHT){
road=“;
arrow+=tile.flipped
? drawArrow(50,20,0)+drawArrow(50,50,0)+drawArrow(50,80,0)
: drawArrow(50,20,180)+drawArrow(50,50,180)+drawArrow(50,80,180);
}
else if(tile.type===TYPE.CORNER){
road=`
arrow+=tile.flipped
? drawArrow(85,50,-90)+drawArrow(60,40,-45)+drawArrow(50,15,0)
: drawArrow(50,15,180)+drawArrow(60,40,135)+drawArrow(85,50,90);
}
else if(tile.type===TYPE.T){
road=`
`;
switch(tile.mode){
case 0: arrow+=drawArrow(50,15,180)+drawArrow(60,40,135)+drawArrow(85,50,90); break;
case 1: arrow+=drawArrow(85,50,-90)+drawArrow(60,40,-45)+drawArrow(50,15,0); break;
case 2: arrow+=drawArrow(20,50,90)+drawArrow(50,50,90)+drawArrow(80,50,90); break;
case 3: arrow+=drawArrow(20,50,-90)+drawArrow(50,50,-90)+drawArrow(80,50,-90); break;
}
}
else if(tile.type===TYPE.CROSS){
road=`
`;
switch(tile.mode){
case 0: arrow+=drawArrow(50,20,180)+drawArrow(50,50,180)+drawArrow(50,80,180); break;
case 1: arrow+=drawArrow(50,20,0)+drawArrow(50,50,0)+drawArrow(50,80,0); break;
case 2: arrow+=drawArrow(50,15,180)+drawArrow(60,40,135)+drawArrow(85,50,90); break;
case 3: arrow+=drawArrow(85,50,-90)+drawArrow(60,40,-45)+drawArrow(50,15,0); break;
}
}
return ``;
}
})();
How to Play Rocket & Globe Game – Accenture Gaming Round Practice
This Maze and Rat Game, also known as the Rocket & Globe Game, is designed to help you
practice the same logic used in the Accenture Gaming Round.
Play the game carefully and focus on finding the correct path instead of making random moves.
Game Objective
Your goal is to move the rocket (or rat) from the starting point to the globe (destination)
by selecting the correct and shortest path inside the maze.
How This Practice Game Helps
- Improves maze-solving and pathfinding logic
- Builds confidence before the actual Accenture exam
- Helps you understand dead ends and wrong paths
- Enhances logical and visual thinking skills
Tips to Score Better in Accenture Gaming Round
- Observe the full maze before making your first move
- Avoid trial-and-error clicking
- Choose paths with fewer turns
- Stay calm and think logically
Important Note for Candidates
This practice game is created only for learning and preparation.
Actual Accenture gaming round questions may vary, but the core logic and difficulty level remain similar.