Frame 1
gotoAndPlay (3);
Frame 2
gotoAndPlay (3);
Frame 3
function selectCell(cell) {
if ((((!plate._visible) && (playerIsHuman[playerTurn])) && (!cell.solved)) && (!strobing)) {
curCell = cell;
curCell.gotoAndStop(34);
szCell = String(cell);
szcl = szCell.length;
cx = szCell.charAt(szcl - 4);
cy = szCell.charAt(szcl - 3);
gx = szCell.charAt(szcl - 2);
gy = szCell.charAt(szcl - 1);
plateShowSFX.start();
plate._visible = true;
l = 1;
while (l < 10) {
if (!curCell.playerWork[playerTurn][l - 1]) {
tellTarget ("plate.pt" + l) {
gotoAndStop (2);
};
tellTarget ("plate.b" + l) {
_visible = false;
};
} else {
tellTarget ("plate.pt" + l) {
gotoAndStop (1);
};
tellTarget ("plate.b" + l) {
_visible = true;
};
}
l++;
}
}
}
function testCellNum(n) {
if (curCell.correctNum == n) {
curCell.num.gotoAndStop(n + 1);
curCell.solved = true;
if (curCell.owner == -2) {
if (curCell.owner < 0) {
curCell.owner = playerTurn;
}
gridCountNeeded = 9;
gridCount = 0;
lcy = 1;
while (lcy < 4) {
lcx = 1;
while (lcx < 4) {
tellTarget (((("board.c" + lcx) + lcy) + gx) + gy) {
if (owner == -1) {
_root.gridCountNeeded--;
}
if (owner == _root.playerTurn) {
_root.gridCount++;
}
};
lcx++;
}
lcy++;
}
if (gridCountNeeded && (gridCount > (gridCountNeeded / 2))) {
lcy = 1;
while (lcy < 4) {
lcx = 1;
while (lcx < 4) {
tellTarget (((("board.c" + lcx) + lcy) + gx) + gy) {
owner = _root.playerTurn;
gotoAndStop(owner + 32);
};
lcx++;
}
lcy++;
}
pT = playerTurn;
gS[gx - 1][gy - 1] = pT;
if (((gS[0][0] == pT) && (gs[1][0] == pT)) && (gs[2][0] == pT)) {
gameWon = 1;
}
if (((gS[0][1] == pT) && (gs[1][1] == pT)) && (gs[2][1] == pT)) {
gameWon = 1;
}
if (((gS[0][2] == pT) && (gs[1][2] == pT)) && (gs[2][2] == pT)) {
gameWon = 1;
}
if (((gS[0][0] == pT) && (gs[0][1] == pT)) && (gs[0][2] == pT)) {
gameWon = 1;
}
if (((gS[1][0] == pT) && (gs[1][1] == pT)) && (gs[1][2] == pT)) {
gameWon = 1;
}
if (((gS[2][0] == pT) && (gs[2][1] == pT)) && (gs[2][2] == pT)) {
gameWon = 1;
}
if (((gS[0][0] == pT) && (gs[1][1] == pT)) && (gs[2][2] == pT)) {
gameWon = 1;
}
if (((gS[2][0] == pT) && (gs[1][1] == pT)) && (gs[0][2] == pT)) {
gameWon = 1;
}
if (gameWon) {
strobeDelay = -100;
board.lights.gfx.gotoAndStop(6);
} else {
board.lights.gfx.gotoAndStop(5);
}
strobing = true;
} else {
playerTurn = playerTurn ^ 1;
board.lights.gfx.gotoAndStop(playerTurn + 2);
}
} else {
playerTurn = playerTurn ^ 1;
board.lights.gfx.gotoAndStop(playerTurn + 2);
}
} else {
board.lights.gfx.gotoAndStop(4);
strobing = true;
}
curCell.gotoAndStop(curCell.owner + 32);
}
if (!sudokuInit) {
playerTurn = -1;
dbGrid = new Array(new Array(4, 6, 9, 2, 7, 3, 1, 5, 8, 1, 8, 2, 6, 4, 5, 7, 3, 9, 7, 5, 3, 1, 8, 9, 6, 2, 4, 3, 1, 5, 6, 2, 4, 8, 9, 7, 8, 2, 7, 9, 5, 1, 3, 6, 4, 9, 4, 6, 8, 3, 7, 2, 1, 5, 9, 8, 2, 5, 3, 1, 7, 4, 6, 4, 7, 3, 2, 9, 6, 5, 1, 8, 5, 6, 1, 4, 7, 8, 3, 9, 2), new Array(6, 7, 3, 8, 2, 5, 4, 9, 1, 9, 8, 4, 7, 1, 6, 3, 2, 5, 5, 2, 1, 4, 3, 9, 8, 7, 6, 1, 8, 2, 3, 4, 7, 5, 6, 9, 6, 3, 9, 1, 5, 2, 4, 7, 8, 7, 4, 5, 9, 6, 8, 2, 1, 3, 7, 5, 8, 9, 3, 6, 2, 1, 4, 2, 6, 1, 5, 4, 7, 8, 9, 3, 3, 9, 4, 1, 8, 2, 6, 5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0;
lgy = 1;
while (lgy < 4) {
lgx = 1;
while (lgx < 4) {
lcy = 1;
while (lcy < 4) {
lcx = 1;
while (lcx < 4) {
tellTarget (((("board.c" + lcx) + lcy) + lgx) + lgy) {
correctNum = _root.testGrid[_root.gi];
if (_root.testGridMask[_root.gi]) {
solved = true;
owner = _root.playerTurn;
gotoAndStop(_root.playerTurn + 32);
num.gotoAndStop(correctNum + 1);
} else {
solved = false;
owner = -2;
gotoAndStop (30);
num.gotoAndStop(1);
}
};
gi++;
lcx++;
}
lcy++;
}
lgx++;
}
lgy++;
}
plateToggleSFX = new Sound();
plateToggleSFX.attachSound("sfx0");
consoleToggleSFX = new Sound();
consoleToggleSFX.attachSound("sfx1");
plateShowSFX = new Sound();
plateShowSFX.attachSound("sfx2");
plateButtonSFX = new Sound();
plateButtonSFX.attachSound("sfx3");
cpuMoveSFX = new Sound();
cpuMoveSFX.attachSound("sfx4");
curCell = 0;
cx = 0;
cy = 0;
gx = 0;
gy = 0;
cpuDelay = 0;
gridCountNeeded = 0;
gridCount = 0;
strobing = false;
strobeDelay = 0;
gameWon = 0;
pT = 0;
gS = new Array(new Array(-2, -2, -2), new Array(-2, -2, -2), new Array(-2, -2, -2));
playerIsHuman = new Array(true, false);
plate._visible = false;
platePulse = false;
consoleToggle = false;
consoleIsUp = false;
playerTurn = 0;
board.lights.gfx.gotoAndStop(playerTurn + 2);
sudokuInit = true;
}
if (strobing) {
strobeDelay++;
if (strobeDelay > 60) {
if (gameWon) {
if (playerTurn == 0) {
gotoAndStop (8);
} else {
gotoAndStop (13);
}
}
playerTurn = playerTurn ^ 1;
board.lights.gfx.gotoAndStop(playerTurn + 2);
strobeDelay = 0;
strobing = false;
}
}
if ((!playerIsHuman[playerTurn]) && (!strobing)) {
cpuDelay++;
if (cpuDelay > 30) {
curCell = 0;
cpuDone = 0;
do {
cx = Math.round(Math.random() * 2) + 1;
cy = Math.round(Math.random() * 2) + 1;
gx = Math.round(Math.random() * 2) + 1;
gy = Math.round(Math.random() * 2) + 1;
cpuSelect = ((("board.c" + cx) + cy) + gx) + gy;
tellTarget (cpuSelect) {
if (!solved) {
_root.cpuMoveSFX.start();
hackfix();
_root.cpuDone = 1;
}
};
} while (!cpuDone);
cpuDelay = 0;
}
}
if (consoleToggle) {
if (consoleIsUp) {
console._y = console._y + 20;
board._y = board._y + 10;
plate._y = plate._y + 20;
if (console._y >= 700) {
console._y = 700;
consoleToggle = false;
console.consoleButton._rotation = 0;
consoleIsUp = false;
}
} else {
console._y = console._y - 20;
board._y = board._y - 10;
plate._y = plate._y - 20;
if (console._y <= 400) {
console._y = 400;
consoleToggle = false;
console.consoleButton._rotation = 180;
consoleIsUp = true;
}
}
}
Frame 4
gotoAndPlay (3);
Frame 5
gotoAndPlay (3);
Frame 6
gotoAndStop (8);
Frame 7
gotoAndStop (8);
Frame 8
stop();
Frame 9
gotoAndStop (8);
Frame 10
gotoAndStop (8);
Frame 11
gotoAndStop (13);
Frame 12
gotoAndStop (13);
Frame 13
stop();
Frame 14
gotoAndStop (13);
Frame 15
gotoAndStop (13);
Symbol 8 Button
on (release) {
_root.selectCell(this);
}
Symbol 18 MovieClip Frame 1
stop();
Symbol 18 MovieClip Frame 2
stop();
Symbol 18 MovieClip Frame 3
stop();
Symbol 18 MovieClip Frame 4
stop();
Symbol 18 MovieClip Frame 5
stop();
Symbol 18 MovieClip Frame 6
stop();
Symbol 18 MovieClip Frame 7
stop();
Symbol 18 MovieClip Frame 8
stop();
Symbol 18 MovieClip Frame 9
stop();
Symbol 18 MovieClip Frame 10
stop();
Symbol 19 MovieClip Frame 1
function hackfix() {
_root.curCell = this;
_root.testCellNum(correctNum);
}
solved = false;
owner = -2;
playerWork = new Array(new Array(1, 1, 1, 1, 1, 1, 1, 1, 1), new Array(1, 1, 1, 1, 1, 1, 1, 1, 1));
Symbol 19 MovieClip Frame 30
stop();
Symbol 19 MovieClip Frame 31
stop();
Symbol 19 MovieClip Frame 32
stop();
Symbol 19 MovieClip Frame 33
stop();
Symbol 19 MovieClip Frame 34
stop();
Symbol 37 MovieClip Frame 1
stop();
Symbol 37 MovieClip Frame 2
stop();
Symbol 37 MovieClip Frame 3
stop();
Symbol 37 MovieClip Frame 4
stop();
Symbol 37 MovieClip Frame 5
stop();
Symbol 37 MovieClip Frame 6
stop();
Symbol 43 Button
on (release) {
_root.plateToggleSFX.start();
b1._visible = b1._visible ^ true;
pt1.play();
_root.curCell.playerWork[_root.playerTurn][0] = _root.curCell.playerWork[_root.playerTurn][0] ^ 1;
}
Symbol 44 Button
on (release) {
_root.plateToggleSFX.start();
b2._visible = b2._visible ^ true;
pt2.play();
_root.curCell.playerWork[_root.playerTurn][1] = _root.curCell.playerWork[_root.playerTurn][1] ^ 1;
}
Symbol 45 Button
on (release) {
_root.plateToggleSFX.start();
b3._visible = b3._visible ^ true;
pt3.play();
_root.curCell.playerWork[_root.playerTurn][2] = _root.curCell.playerWork[_root.playerTurn][2] ^ 1;
}
Symbol 46 Button
on (release) {
_root.plateToggleSFX.start();
b4._visible = b4._visible ^ true;
pt4.play();
_root.curCell.playerWork[_root.playerTurn][3] = _root.curCell.playerWork[_root.playerTurn][3] ^ 1;
}
Symbol 47 Button
on (release) {
_root.plateToggleSFX.start();
b5._visible = b5._visible ^ true;
pt5.play();
_root.curCell.playerWork[_root.playerTurn][4] = _root.curCell.playerWork[_root.playerTurn][4] ^ 1;
}
Symbol 48 Button
on (release) {
_root.plateToggleSFX.start();
b6._visible = b6._visible ^ true;
pt6.play();
_root.curCell.playerWork[_root.playerTurn][5] = _root.curCell.playerWork[_root.playerTurn][5] ^ 1;
}
Symbol 49 Button
on (release) {
_root.plateToggleSFX.start();
b7._visible = b7._visible ^ true;
pt7.play();
_root.curCell.playerWork[_root.playerTurn][6] = _root.curCell.playerWork[_root.playerTurn][6] ^ 1;
}
Symbol 50 Button
on (release) {
_root.plateToggleSFX.start();
b8._visible = b8._visible ^ true;
pt8.play();
_root.curCell.playerWork[_root.playerTurn][7] = _root.curCell.playerWork[_root.playerTurn][7] ^ 1;
}
Symbol 51 Button
on (release) {
_root.plateToggleSFX.start();
b9._visible = b9._visible ^ true;
pt9.play();
_root.curCell.playerWork[_root.playerTurn][8] = _root.curCell.playerWork[_root.playerTurn][8] ^ 1;
}
Symbol 53 Button
on (release) {
_root.plateButtonSFX.start();
_root.curCell.gotoAndStop(30);
_visible = false;
}
Symbol 54 Button
on (release) {
_root.plateButtonSFX.start();
_root.testCellNum(1);
_visible = false;
}
Symbol 55 Button
on (release) {
_root.plateButtonSFX.start();
_root.testCellNum(2);
_visible = false;
}
Symbol 56 Button
on (release) {
_root.plateButtonSFX.start();
_root.testCellNum(3);
_visible = false;
}
Symbol 57 Button
on (release) {
_root.plateButtonSFX.start();
_root.testCellNum(4);
_visible = false;
}
Symbol 58 Button
on (release) {
_root.plateButtonSFX.start();
_root.testCellNum(9);
_visible = false;
}
Symbol 59 Button
on (release) {
_root.plateButtonSFX.start();
_root.testCellNum(8);
_visible = false;
}
Symbol 60 Button
on (release) {
_root.plateButtonSFX.start();
_root.testCellNum(7);
_visible = false;
}
Symbol 61 Button
on (release) {
_root.plateButtonSFX.start();
_root.testCellNum(6);
_visible = false;
}
Symbol 62 Button
on (release) {
_root.plateButtonSFX.start();
_root.testCellNum(5);
_visible = false;
}
Symbol 66 MovieClip Frame 1
stop();
Symbol 66 MovieClip Frame 2
stop();
Symbol 69 MovieClip Frame 1
stop();
Symbol 69 MovieClip Frame 2
stop();
Symbol 72 MovieClip Frame 1
stop();
Symbol 72 MovieClip Frame 2
stop();
Symbol 75 MovieClip Frame 1
stop();
Symbol 75 MovieClip Frame 2
stop();
Symbol 78 MovieClip Frame 1
stop();
Symbol 78 MovieClip Frame 2
stop();
Symbol 81 MovieClip Frame 1
stop();
Symbol 81 MovieClip Frame 2
stop();
Symbol 84 MovieClip Frame 1
stop();
Symbol 84 MovieClip Frame 2
stop();
Symbol 87 MovieClip Frame 1
stop();
Symbol 87 MovieClip Frame 2
stop();
Symbol 90 MovieClip Frame 1
stop();
Symbol 90 MovieClip Frame 2
stop();
Symbol 98 MovieClip Frame 1
if (!plateInit) {
b0._;
}
Symbol 109 Button
on (release) {
_root.consoleToggleSFX.start();
_root.consoleToggle = 1;
}