Frame 1
stop();
loadBar._xscale = 1;
onEnterFrame = function () {
if (!loadedGame) {
if (_root.getBytesLoaded() >= _root.getBytesTotal()) {
loadedGame = true;
gotoAndPlay ("loaded");
}
l_geladen = _root.getBytesLoaded();
l_totaal = _root.getBytesTotal();
l_gedeeld = l_geladen / l_totaal;
l_percentage = int(100 * l_gedeeld);
loadBar._xscale = l_percentage;
}
};
Frame 45
gotoAndStop ("menu");
Frame 46
function loadVars_() {
loadedVars = true;
lang = "en";
highscores_1 = SharedObject.getLocal("sudoku_hs_easy");
hsArray_1 = new Array();
if (highscores_1.data.storage[0].n ne undefined) {
hsArray_1 = highscores_1.data.storage;
} else {
hsArray_1.push({n:"William", t:900000});
hsArray_1.push({n:"Jim", t:1000000});
hsArray_1.push({n:"Mike", t:1200000});
hsArray_1.push({n:"Dave", t:1300000});
hsArray_1.push({n:"Roy", t:1500000});
hsArray_1.push({n:"Clark", t:1550000});
hsArray_1.push({n:"Jan", t:1600000});
hsArray_1.push({n:"Eve", t:1700000});
hsArray_1.push({n:"Mary", t:1800000});
hsArray_1.push({n:"Janice", t:2000000});
}
highscores_1.data.storage = hsArray_1;
highscores_1.flush();
highscores_2 = SharedObject.getLocal("sudoku_hs_med");
hsArray_2 = new Array();
if (highscores_2.data.storage[0].n ne undefined) {
hsArray_2 = highscores_2.data.storage;
} else {
hsArray_2.push({n:"William", t:1300000});
hsArray_2.push({n:"Jim", t:1500000});
hsArray_2.push({n:"Mike", t:1700000});
hsArray_2.push({n:"Dave", t:1800000});
hsArray_2.push({n:"Roy", t:1900000});
hsArray_2.push({n:"Clark", t:2050000});
hsArray_2.push({n:"Jan", t:2200000});
hsArray_2.push({n:"Eve", t:2300000});
hsArray_2.push({n:"Mary", t:2350000});
hsArray_2.push({n:"Janice", t:2500000});
}
highscores_2.data.storage = hsArray_2;
highscores_2.flush();
highscores_3 = SharedObject.getLocal("sudoku_hs_hard");
hsArray_3 = new Array();
if (highscores_3.data.storage[0].n ne undefined) {
hsArray_3 = highscores_3.data.storage;
} else {
hsArray_3.push({n:"William", t:2100000});
hsArray_3.push({n:"Jim", t:2300000});
hsArray_3.push({n:"Mike", t:2400000});
hsArray_3.push({n:"Dave", t:2550000});
hsArray_3.push({n:"Roy", t:2600000});
hsArray_3.push({n:"Clark", t:2750000});
hsArray_3.push({n:"Jan", t:2900000});
hsArray_3.push({n:"Eve", t:3000000});
hsArray_3.push({n:"Mary", t:3150000});
hsArray_3.push({n:"Janice", t:3500000});
}
highscores_3.data.storage = hsArray_3;
highscores_3.flush();
highscores_4 = SharedObject.getLocal("soku_hs_easy");
hsArray_4 = new Array();
if (highscores_4.data.storage[0].n ne undefined) {
hsArray_4 = highscores_4.data.storage;
} else {
hsArray_4.push({n:"William", t:240000});
hsArray_4.push({n:"Jim", t:280000});
hsArray_4.push({n:"Mike", t:300000});
hsArray_4.push({n:"Dave", t:350000});
hsArray_4.push({n:"Roy", t:500000});
hsArray_4.push({n:"Clark", t:650000});
hsArray_4.push({n:"Jan", t:700000});
hsArray_4.push({n:"Eve", t:830000});
hsArray_4.push({n:"Mary", t:950000});
hsArray_4.push({n:"Janice", t:1000000});
}
highscores_4.data.storage = hsArray_4;
highscores_4.flush();
highscores_5 = SharedObject.getLocal("soku_hs_med");
hsArray_5 = new Array();
if (highscores_5.data.storage[0].n ne undefined) {
hsArray_5 = highscores_5.data.storage;
} else {
hsArray_5.push({n:"William", t:380000});
hsArray_5.push({n:"Jim", t:400000});
hsArray_5.push({n:"Mike", t:450000});
hsArray_5.push({n:"Dave", t:550000});
hsArray_5.push({n:"Roy", t:630000});
hsArray_5.push({n:"Clark", t:700000});
hsArray_5.push({n:"Jan", t:720000});
hsArray_5.push({n:"Eve", t:980000});
hsArray_5.push({n:"Mary", t:1050000});
hsArray_5.push({n:"Janice", t:1200000});
}
highscores_5.data.storage = hsArray_5;
highscores_5.flush();
highscores_6 = SharedObject.getLocal("soku_hs_hard");
hsArray_6 = new Array();
if (highscores_6.data.storage[0].n ne undefined) {
hsArray_6 = highscores_6.data.storage;
} else {
hsArray_6.push({n:"William", t:500000});
hsArray_6.push({n:"Jim", t:580000});
hsArray_6.push({n:"Mike", t:630000});
hsArray_6.push({n:"Dave", t:700000});
hsArray_6.push({n:"Roy", t:780000});
hsArray_6.push({n:"Clark", t:850000});
hsArray_6.push({n:"Jan", t:920000});
hsArray_6.push({n:"Eve", t:1100000});
hsArray_6.push({n:"Mary", t:1310000});
hsArray_6.push({n:"Janice", t:1500000});
}
highscores_6.data.storage = hsArray_6;
highscores_6.flush();
}
function clearAll() {
var _local2 = 0;
while (_local2 < 9) {
var _local1 = 0;
while (_local1 < 9) {
removeMovieClip(hokjesArray[_local2][_local1]);
_local1++;
}
_local2++;
}
clearHokje();
}
function clearHokje() {
removeMovieClip(zoomhokje);
}
function retry() {
var _local2 = 0;
while (_local2 lt 9) {
var _local1 = 0;
while (_local1 lt 9) {
if (showMe[_local2][_local1]) {
hokjesArray[_local2][_local1].bg.val = playfield[_local2][_local1];
hokjesArray[_local2][_local1].notclickable = true;
} else {
hokjesArray[_local2][_local1].bg.val = "";
hokjesArray[_local2][_local1].notclickable = false;
}
hokjesArray[_local2][_local1].x = _local2;
hokjesArray[_local2][_local1].y = _local1;
_local1++;
}
_local2++;
}
}
function attachHokje(x, y, val, i, k) {
highScore = false;
zoomhokje = attachMovie("zoomhokje", "zoomhokje" + zoomhokjeID, 10000);
zoomhokje._x = x;
zoomhokje._y = y;
if (val != undefined) {
zoomhokje.bg.val = val;
}
zoomhokje.i = i;
zoomhokje.k = k;
zoomhokje.id = zoomhokje;
if ((((i - 3) lt 0) or ((i - 3) gt 2)) and (((k - 3) lt 0) or ((k - 3) gt 2))) {
zoomhokje.bg.gotoAndStop(2);
}
if (((((i - 3) ge 0) and ((i - 3) lt 3)) and ((k - 3) ge 0)) and ((k - 3) lt 3)) {
zoomhokje.bg.gotoAndStop(3);
}
}
function showStaticNumbers(playFieldArray, hokjes, showAmount) {
if (showAmount == 32) {
maxFives = 1;
maxFours = 3;
maxThree = 5;
} else if (showAmount == 34) {
maxFives = 1;
maxFours = 5;
maxThree = 3;
} else if (showAmount == 36) {
maxFives = 3;
maxFours = 3;
maxThree = 3;
}
showAmountArray = new Array();
checkAmountArray = new Array();
var _local2 = 0;
while (_local2 lt 3) {
showAmountArray[_local2] = new Array();
checkAmountArray[_local2 + 3] = 0;
_local2++;
}
var _local3 = 0;
while (_local3 lt 3) {
var _local1 = 0;
while (_local1 lt 3) {
showNumber = random(3) + 3;
trace(showNumber);
if ((showNumber eq 5) and (checkAmountArray[5] eq maxFives)) {
showNumber = random(2) + 3;
if ((showNumber eq 4) and (checkAmountArray[4] eq maxFours)) {
showNumber = 3;
} else if ((showNumber eq 3) and (checkAmountArray[3] eq maxThree)) {
showNumber = 4;
}
} else if ((showNumber eq 4) and (checkAmountArray[4] eq maxFours)) {
showNumber = randomChange(1) + 3;
if ((showNumber eq 5) and (checkAmountArray[5] eq maxFives)) {
showNumber = 3;
} else if ((showNumber eq 3) and (checkAmountArray[3] eq maxThree)) {
showNumber = 5;
}
} else if ((showNumber eq 3) and (checkAmountArray[3] eq maxThree)) {
showNumber = random(2) + 4;
if ((showNumber eq 4) and (checkAmountArray[4] eq maxFours)) {
showNumber = 5;
} else if ((showNumber eq 5) and (checkAmountArray[5] eq maxFives)) {
showNumber = 4;
}
}
checkAmountArray[showNumber]++;
showAmountArray[_local3][_local1] = showNumber;
_local1++;
}
_local3++;
}
trace(showAmountArray);
return(showAmountArray);
}
function randomChange(num) {
reCheck = random(2);
if ((num eq 0) and (reCheck eq 0)) {
return(1);
}
if ((num eq 0) and (reCheck eq 1)) {
return(2);
}
if ((num eq 1) and (reCheck eq 0)) {
return(0);
}
if ((num eq 1) and (reCheck eq 1)) {
return(2);
}
if ((num eq 2) and (reCheck eq 0)) {
return(0);
}
if ((num eq 2) and (reCheck eq 1)) {
return(1);
}
}
function showHokjes(hokjesAmount, showAmount) {
if (showAmount == 32) {
maxFives = 1;
maxFours = 4;
} else if (showAmount == 34) {
maxFives = 1;
maxFours = 6;
} else if (showAmount == 36) {
maxFives = 3;
maxFours = 6;
}
fours = 0;
fives = 0;
sAmount = 0;
checkAmountArray = new Array();
truthTable = new Array();
posNum = new Array();
tempPosNum = new Array();
var _local4 = 0;
while (_local4 lt 9) {
truthTable[_local4] = new Array();
checkAmountArray[_local4 + 1] = 0;
posNum[_local4] = _local4 + 1;
_local4++;
}
_local4 = 0;
while (_local4 < 3) {
var _local3 = 0;
while (_local3 < 3) {
var _local5 = 0;
while (_local5 < posNum.length) {
tempPosNum[_local5] = posNum[_local5];
_local5++;
}
_local5 = 0;
while (_local5 < hokjesAmount[_local4][_local3]) {
if (fives == maxFives) {
var _local2 = 0;
while (_local2 < checkAmountArray.length) {
if (checkAmountArray[_local2] == 4) {
trace("splicing: " + _local2);
var _local1 = 0;
while (_local1 < posNum.length) {
if (posNum[_local1] == _local2) {
posNum.splice(_local1, 1);
}
_local1++;
}
_local1 = 0;
while (_local1 < tempPosNum.length) {
if (tempPosNum[_local1] == _local2) {
tempPosNum.splice(_local1, 1);
}
_local1++;
}
}
_local2++;
}
}
if (fours == maxFours) {
var _local2 = 0;
while (_local2 < checkAmountArray.length) {
if (checkAmountArray[_local2] == 3) {
var _local1 = 0;
while (_local1 < posNum.length) {
if (posNum[_local1] == _local2) {
posNum.splice(_local1, 1);
}
_local1++;
}
_local1 = 0;
while (_local1 < tempPosNum.length) {
if (tempPosNum[_local1] == _local2) {
tempPosNum.splice(_local1, 1);
}
_local1++;
}
}
_local2++;
}
}
found = false;
sCheck = 0;
lowestNumArray = new Array();
while (sCheck == 0) {
var _local2 = 0;
while (_local2 < tempPosNum.length) {
if (checkAmountArray[tempPosNum[_local2]] == sAmount) {
sCheck++;
lowestNumArray.push(tempPosNum[_local2]);
}
_local2++;
}
if (sCheck == 0) {
sAmount++;
}
}
rIndex = random(lowestNumArray.length);
rNum = lowestNumArray[rIndex];
if (rNum == undefined) {
trace(posNum);
}
var _local1 = 0;
while (_local1 < tempPosNum.length) {
if (tempPosNum[_local1] == rNum) {
tempPosNum.splice(_local1, 1);
}
_local1++;
}
checkAmountArray[rNum]++;
if (checkAmountArray[rNum] == 4) {
fours++;
} else if (checkAmountArray[rNum] == 5) {
fives++;
maxFours--;
fours--;
}
trace((((((rNum + "->") + checkAmountArray[rNum]) + " ") + fives) + "-") + maxFives);
if (checkAmountArray[rNum] == 5) {
trace("splicing: " + rNum);
var _local2 = 0;
while (_local2 < posNum.length) {
if (posNum[_local2] == rNum) {
posNum.splice(_local2, 1);
}
_local2++;
}
}
var _local2 = _local4 * 3;
while (_local2 < ((_local4 * 3) + 3)) {
_local1 = _local3 * 3;
while (_local1 < ((_local3 * 3) + 3)) {
if (playfield[_local2][_local1] == rNum) {
truthTable[_local2][_local1] = true;
found = true;
break;
}
_local1++;
}
if (found) {
break;
}
_local2++;
}
_local5++;
}
_local3++;
}
_local4++;
}
return(truthTable);
}
function controle(k, i) {
var _local2 = 0;
while (_local2 < 9) {
if ((hokjesArray[k][_local2].bg.val == hokjesArray[k][i].bg.val) and (_local2 != i)) {
return(false);
}
if ((hokjesArray[_local2][i].bg.val == hokjesArray[k][i].bg.val) and (_local2 != k)) {
return(false);
}
_local2++;
}
if (k < 3) {
j = 0;
} else if (k < 6) {
j = 3;
} else {
j = 6;
}
if (i < 3) {
l = 0;
} else if (i < 6) {
l = 3;
} else {
l = 6;
}
_local2 = j;
while (_local2 < (j + 3)) {
var _local1 = l;
while (_local1 < (l + 3)) {
if (((hokjesArray[_local2][_local1].bg.val == hokjesArray[k][i].bg.val) and (_local2 != k)) and (_local1 != i)) {
return(false);
}
if (hokjesArray[_local2][_local1].bg.val == undefined) {
return(false);
}
_local1++;
}
_local2++;
}
return(true);
}
function checkAnswer() {
tempanswer = 3;
trace("---");
var _local1 = 0;
while (_local1 lt 9) {
var _local2 = 0;
while (_local2 lt 9) {
if (!controle(_local2, _local1)) {
tempanswer = 5;
trace((_local2 + ",") + _local1);
}
_local2++;
}
_local1++;
}
answer = tempanswer;
if (answer == 3) {
_local1 = 0;
while (_local1 < 10) {
if (menU.game == "sudoku") {
if ((difi == 36) and (highscores_1.data.storage[_local1].t > timer)) {
highScore = true;
} else if ((difi == 34) and (highscores_2.data.storage[_local1].t > timer)) {
highScore = true;
} else if ((difi == 32) and (highscores_3.data.storage[_local1].t > timer)) {
highScore = true;
}
} else if (menU.game == "soku") {
if ((difi == 36) and (highscores_4.data.storage[_local1].t > timer)) {
highScore = true;
} else if ((difi == 34) and (highscores_5.data.storage[_local1].t > timer)) {
highScore = true;
} else if ((difi == 32) and (highscores_6.data.storage[_local1].t > timer)) {
highScore = true;
}
}
_local1++;
}
if (highScore) {
clearAll();
menU.gotoAndPlay("highscore");
}
}
}
stop();
if (!gameLoaded) {
gameLoaded = true;
gotoAndPlay (49);
}
clearAll();
if (!loadedVars) {
loadVars_();
}
Frame 47
function main() {
answer = 1;
timeCorrection = getTimer();
showAnswer.gotoAndStop(1);
answer = undefined;
answerString = undefined;
showAnswer.gotoAndStop(0);
fieldX = 185;
fieldY = 75;
placeAdjustX = 26;
placeAdjustY = 26;
createField();
}
function createField() {
playfield = new Array();
numberArray = new Array();
hokjesArray = new Array();
hokjeIndex = 0;
var _local4 = 0;
while (_local4 lt 9) {
playfield[_local4] = new Array();
hokjesArray[_local4] = new Array();
var _local6 = 0;
while (_local6 lt 9) {
hokjeIndex++;
attachMovie("hokje", "hokje" + hokjeIndex, 10 + hokjeIndex);
hokje = _root["hokje" + hokjeIndex];
hokje._x = fieldX + (_local4 * placeAdjustX);
hokje._y = fieldY + (_local6 * placeAdjustY);
hokjesArray[_local4][_local6] = hokje;
if ((((_local6 - 3) lt 0) or ((_local6 - 3) gt 2)) and (((_local4 - 3) lt 0) or ((_local4 - 3) gt 2))) {
hokje.bg.gotoAndStop(2);
}
if (((((_local6 - 3) ge 0) and ((_local6 - 3) lt 3)) and ((_local4 - 3) ge 0)) and ((_local4 - 3) lt 3)) {
hokje.bg.gotoAndStop(3);
}
_local6++;
}
_local4++;
}
var _local5 = 0;
while (_local5 lt 3) {
var _local3 = 0;
while (_local3 lt 3) {
playfield[_local3][_local5] = genRandom();
playfield[_local3 + 3][_local5] = playfield[_local3][_local5];
playfield[_local3 + 6][_local5] = playfield[_local3][_local5];
_local4 = 0;
while (_local4 le 6) {
var _local2 = 0;
while (_local2 le 6) {
if (_local4 gt 2) {
playfield[_local3 + _local2][_local5 + _local4] = playfield[_local3][_local5];
}
_local2 = _local2 + 3;
}
_local4 = _local4 + 3;
}
_local3++;
}
_local5++;
}
playfield = swap(playfield);
showHokjesAmount = showStaticNumbers(playfield, hokjesArray, difi);
showMe = showHokjes(showHokjesAmount, difi);
_local4 = 0;
while (_local4 lt 9) {
var _local2 = 0;
while (_local2 lt 9) {
if (showMe[_local4][_local2]) {
hokjesArray[_local4][_local2].bg.val = playfield[_local4][_local2];
hokjesArray[_local4][_local2].notclickable = true;
} else {
hokjesArray[_local4][_local2].bg.val = "";
hokjesArray[_local4][_local2].notclickable = false;
}
hokjesArray[_local4][_local2].x = _local4;
hokjesArray[_local4][_local2].y = _local2;
_local2++;
}
_local4++;
}
}
function genRandom() {
randomNum = random(9) + 1;
while (!checkRandom(randomNum)) {
randomNum = random(9) + 1;
}
return(randomNum);
}
function checkRandom(num) {
var _local2 = 0;
while (_local2 lt 3) {
var _local1 = 0;
while (_local1 lt 3) {
if (playfield[_local1][_local2] eq num) {
return(false);
}
_local1++;
}
_local2++;
}
return(true);
}
function swapFieldsSet() {
horArray = new Array();
var _local1 = 0;
while (_local1 lt 3) {
horArray[_local1] = new Array();
_local1++;
}
_local1 = 0;
while (_local1 le 6) {
horArray[0][0 + _local1] = random(3);
horArray[0][1 + _local1] = randomChange(horArray[0][0 + _local1]);
horArray[0][2 + _local1] = staticChange(horArray[0][0 + _local1], horArray[0][1 + _local1]);
_local1 = _local1 + 3;
}
_local1 = 0;
while (_local1 le 6) {
horArray[1][0 + _local1] = randomChange(horArray[0][0 + _local1]);
if (horArray[1][0 + _local1] ne horArray[0][1 + _local1]) {
horArray[1][1 + _local1] = doubleChange(horArray[1][0 + _local1], horArray[0][1 + _local1]);
} else {
horArray[1][1 + _local1] = horArray[0][2 + _local1];
}
horArray[1][2 + _local1] = staticChange(horArray[1][0 + _local1], horArray[1][1 + _local1]);
_local1 = _local1 + 3;
}
_local1 = 0;
while (_local1 le 6) {
horArray[2][0 + _local1] = staticChange(horArray[0][0 + _local1], horArray[1][0 + _local1]);
horArray[2][1 + _local1] = staticChange(horArray[0][1 + _local1], horArray[1][1 + _local1]);
horArray[2][2 + _local1] = staticChange(horArray[0][2 + _local1], horArray[1][2 + _local1]);
_local1 = _local1 + 3;
}
return(horArray);
}
function randomChange(num) {
reCheck = random(2);
if ((num eq 0) and (reCheck eq 0)) {
return(1);
}
if ((num eq 0) and (reCheck eq 1)) {
return(2);
}
if ((num eq 1) and (reCheck eq 0)) {
return(0);
}
if ((num eq 1) and (reCheck eq 1)) {
return(2);
}
if ((num eq 2) and (reCheck eq 0)) {
return(0);
}
if ((num eq 2) and (reCheck eq 1)) {
return(1);
}
}
function staticChange(num, num2) {
if (((num eq 0) and (num2 eq 1)) or ((num eq 1) and (num2 eq 0))) {
return(2);
}
if (((num eq 0) and (num2 eq 2)) or ((num eq 2) and (num2 eq 0))) {
return(1);
}
if (((num eq 1) and (num2 eq 2)) or ((num eq 2) and (num2 eq 1))) {
return(0);
}
}
function doubleChange(num, num2) {
if (num ne num2) {
return(staticChange(num, num2));
}
return(randomChange(num));
}
function swap(fieldArray) {
swapArray = swapFieldsSet();
swapArray2 = swapFieldsSet();
swappedArray = new Array();
var _local2 = 0;
while (_local2 lt 9) {
swappedArray[_local2] = new Array();
_local2++;
}
_local2 = 0;
while (_local2 lt 9) {
if (_local2 eq 0) {
factor = 0;
}
if (_local2 eq 3) {
factor = 3;
}
if (_local2 eq 6) {
factor = 6;
}
var _local1 = 0;
while (_local1 lt 3) {
swappedArray[0 + (_local1 * 3)][_local2] = fieldArray[0 + (_local1 * 3)][swapArray[_local1][_local2] + factor];
swappedArray[1 + (_local1 * 3)][_local2] = fieldArray[1 + (_local1 * 3)][swapArray[_local1][_local2] + factor];
swappedArray[2 + (_local1 * 3)][_local2] = fieldArray[2 + (_local1 * 3)][swapArray[_local1][_local2] + factor];
_local1++;
}
_local2++;
}
_local2 = 0;
while (_local2 lt 9) {
if (_local2 eq 0) {
factor = 0;
}
if (_local2 eq 3) {
factor = 3;
}
if (_local2 eq 6) {
factor = 6;
}
var _local1 = 0;
while (_local1 lt 3) {
fieldArray[_local2][0 + (_local1 * 3)] = swappedArray[swapArray2[_local1][_local2] + factor][0 + (_local1 * 3)];
fieldArray[_local2][1 + (_local1 * 3)] = swappedArray[swapArray2[_local1][_local2] + factor][1 + (_local1 * 3)];
fieldArray[_local2][2 + (_local1 * 3)] = swappedArray[swapArray2[_local1][_local2] + factor][2 + (_local1 * 3)];
_local1++;
}
_local2++;
}
return(fieldArray);
}
stop();
main();
timerAdjustment = 0;
onEnterFrame = function () {
if (answer != 3) {
timer = Math.round((getTimer() - timeCorrection) / 1000) * 1000;
}
};
Frame 48
function main() {
timeCorrection = getTimer();
answer = 1;
_root.showAnswer.gotoAndStop(4);
reCreate = false;
timeCorrection = getTimer();
showAnswer.gotoAndStop(1);
answer = undefined;
answerString = undefined;
showAnswer.gotoAndStop(0);
createField();
createArrays();
genField();
showHokjesAmount = showStaticNumbers(playfield, hokjesArray, difi);
showMe = showHokjes(showHokjesAmount, difi);
var _local3 = 0;
while (_local3 lt 9) {
var _local2 = 0;
while (_local2 lt 9) {
if (showMe[_local3][_local2]) {
hokjesArray[_local3][_local2].bg.val = playfield[_local3][_local2];
hokjesArray[_local3][_local2].notclickable = true;
} else {
hokjesArray[_local3][_local2].bg.val = "";
hokjesArray[_local3][_local2].notclickable = false;
}
hokjesArray[_local3][_local2].x = _local3;
hokjesArray[_local3][_local2].y = _local2;
_local2++;
}
_local3++;
}
if (reCreate) {
main();
} else {
showAnswer.gotoAndStop(1);
}
}
function createField() {
fieldCreated = true;
hokjesArray = new Array();
hokjeIndex = 0;
fieldX = 185;
fieldY = 75;
placeAdjustX = 26;
placeAdjustY = 26;
var _local3 = 0;
while (_local3 lt 9) {
hokjesArray[_local3] = new Array();
var _local2 = 0;
while (_local2 lt 9) {
hokjeIndex++;
attachMovie("hokje", "hokje" + hokjeIndex, 10 + hokjeIndex);
hokje = _root["hokje" + hokjeIndex];
hokje._x = fieldX + (_local3 * placeAdjustX);
hokje._y = fieldY + (_local2 * placeAdjustY);
hokjesArray[_local3][_local2] = hokje;
if ((((_local2 - 3) lt 0) or ((_local2 - 3) gt 2)) and (((_local3 - 3) lt 0) or ((_local3 - 3) gt 2))) {
hokje.bg.gotoAndStop(2);
}
if (((((_local2 - 3) ge 0) and ((_local2 - 3) lt 3)) and ((_local3 - 3) ge 0)) and ((_local3 - 3) lt 3)) {
hokje.bg.gotoAndStop(3);
}
_local2++;
}
_local3++;
}
}
function createArrays() {
playfield = new Array();
tempFieldArray = new Array();
var _local2 = 0;
while (_local2 lt 9) {
tempFieldArray[_local2] = new Array();
playfield[_local2] = new Array();
var _local1 = 0;
while (_local1 lt 9) {
hokjesArray[_local2][_local1].val = undefined;
hokjesArray[_local2][_local1].valVar.selectable = true;
_local1++;
}
_local2++;
}
}
function genField() {
retryRow = 0;
var _local2 = 0;
while (_local2 < 9) {
var _local1 = 0;
while (_local1 < 9) {
playfield[_local1][_local2] = undefined;
playfield[_local1][_local2 + 1] = undefined;
numberArray = checkSpot(_local1, _local2);
if (numberArray.length == 0) {
if (retryRow > 40) {
reCreate = true;
break;
}
retryRow++;
_local2--;
_local1 = 0;
} else {
setNum = random(numberArray.length);
setNum = numberArray[setNum];
playfield[_local1][_local2] = setNum;
}
_local1++;
}
if (reCreate) {
break;
}
_local2++;
}
}
function checkSpot(u, v) {
checkArray = new Array();
var _local2 = 1;
while (_local2 <= 9) {
addMe = true;
var _local3 = 0;
while (_local3 < 9) {
if ((playfield[u][_local3] == _local2) or (playfield[_local3][v] == _local2)) {
addMe = false;
}
_local3++;
}
if (u > 0) {
factorX = Math.round((u - 1) / 3);
} else {
factorX = Math.round(u / 3);
}
if (v > 0) {
factorY = Math.round((v - 1) / 3);
} else {
factorY = Math.round(v / 3);
}
var _local4 = factorX * 3;
while (_local4 < ((factorX * 3) + 3)) {
var _local1 = factorY * 3;
while (_local1 < ((factorY * 3) + 3)) {
if (playfield[_local4][_local1] == _local2) {
addMe = false;
}
_local1++;
}
_local4++;
}
if (addMe) {
checkArray.push(_local2);
}
_local2++;
}
return(checkArray);
}
stop();
main();
timerAdjustment = 0;
onEnterFrame = function () {
if (answer != 3) {
timer = Math.round((getTimer() - timeCorrection) / 1000) * 1000;
}
};
Frame 178
gotoAndStop ("menu");
Symbol 6 MovieClip Frame 1
stop();
Symbol 6 MovieClip Frame 2
stop();
Symbol 6 MovieClip Frame 3
stop();
Symbol 9 Button
on (rollOut, dragOut) {
_root.clearHokje();
}
on (release) {
if (_root.myNumber == 0) {
id.bg.val = "";
_root.hokjesArray[i][k].bg.val = "";
} else {
id.bg.val = _root.myNumber;
_root.hokjesArray[i][k].bg.val = _root.myNumber;
}
}
Symbol 11 MovieClip [zoomhokje] Frame 1
but.id = id;
but.i = i;
but.k = k;
Symbol 11 MovieClip [zoomhokje] Frame 5
stop();
but.id = id;
but.i = i;
but.k = k;
Symbol 13 Button
on (rollOver, dragOver) {
_root.attachHokje(this._x, this._y, bg.val, x, y);
}
Symbol 14 MovieClip [hokjeprint] Frame 1
if (notclickable) {
gotoAndStop ("steady2");
}
stop();
but.val = bg.val;
but.x = x;
but.y = y;
Symbol 14 MovieClip [hokjeprint] Frame 2
stop();
Symbol 16 MovieClip [hokje] Frame 9
if (notclickable) {
gotoAndStop ("steady2");
}
stop();
but.val = bg.val;
but.x = x;
but.y = y;
Symbol 16 MovieClip [hokje] Frame 10
stop();
Symbol 23 MovieClip Frame 1
function randomChange(num) {
reCheck = random(2);
if ((num eq 0) and (reCheck eq 0)) {
return(1);
}
if ((num eq 0) and (reCheck eq 1)) {
return(2);
}
if ((num eq 1) and (reCheck eq 0)) {
return(0);
}
if ((num eq 1) and (reCheck eq 1)) {
return(2);
}
if ((num eq 2) and (reCheck eq 0)) {
return(0);
}
if ((num eq 2) and (reCheck eq 1)) {
return(1);
}
}
function showStaticNumbers(playFieldArray, hokjes, showAmount) {
if (showAmount == 32) {
maxFives = 1;
maxFours = 3;
maxThree = 5;
} else if (showAmount == 34) {
maxFives = 1;
maxFours = 5;
maxThree = 3;
} else if (showAmount == 36) {
maxFives = 3;
maxFours = 3;
maxThree = 3;
}
showAmountArray = new Array();
checkAmountArray = new Array();
var _local2 = 0;
while (_local2 lt 3) {
showAmountArray[_local2] = new Array();
checkAmountArray[_local2 + 3] = 0;
_local2++;
}
var _local3 = 0;
while (_local3 lt 3) {
var _local1 = 0;
while (_local1 lt 3) {
showNumber = random(3) + 3;
if ((showNumber eq 5) and (checkAmountArray[5] eq maxFives)) {
showNumber = random(2) + 3;
if ((showNumber eq 4) and (checkAmountArray[4] eq maxFours)) {
showNumber = 3;
} else if ((showNumber eq 3) and (checkAmountArray[3] eq maxThree)) {
showNumber = 4;
}
} else if ((showNumber eq 4) and (checkAmountArray[4] eq maxFours)) {
showNumber = randomChange(1) + 3;
if ((showNumber eq 5) and (checkAmountArray[5] eq maxFives)) {
showNumber = 3;
} else if ((showNumber eq 3) and (checkAmountArray[3] eq maxThree)) {
showNumber = 5;
}
} else if ((showNumber eq 3) and (checkAmountArray[3] eq maxThree)) {
showNumber = random(2) + 4;
if ((showNumber eq 4) and (checkAmountArray[4] eq maxFours)) {
showNumber = 5;
} else if ((showNumber eq 5) and (checkAmountArray[5] eq maxFives)) {
showNumber = 4;
}
}
checkAmountArray[showNumber]++;
showAmountArray[_local3][_local1] = showNumber;
_local1++;
}
_local3++;
}
return(showAmountArray);
}
function showHokjes(hokjesAmount, showAmount) {
if (showAmount == 32) {
maxFives = 1;
maxFours = 4;
} else if (showAmount == 34) {
maxFives = 1;
maxFours = 6;
} else if (showAmount == 36) {
maxFives = 3;
maxFours = 6;
}
fours = 0;
fives = 0;
sAmount = 0;
checkAmountArray = new Array();
truthTable = new Array();
posNum = new Array();
tempPosNum = new Array();
var _local4 = 0;
while (_local4 lt 9) {
truthTable[_local4] = new Array();
checkAmountArray[_local4 + 1] = 0;
posNum[_local4] = _local4 + 1;
_local4++;
}
_local4 = 0;
while (_local4 < 3) {
var _local3 = 0;
while (_local3 < 3) {
var _local5 = 0;
while (_local5 < posNum.length) {
tempPosNum[_local5] = posNum[_local5];
_local5++;
}
_local5 = 0;
while (_local5 < hokjesAmount[_local4][_local3]) {
if (fives == maxFives) {
var _local2 = 0;
while (_local2 < checkAmountArray.length) {
if (checkAmountArray[_local2] == 4) {
var _local1 = 0;
while (_local1 < posNum.length) {
if (posNum[_local1] == _local2) {
posNum.splice(_local1, 1);
}
_local1++;
}
_local1 = 0;
while (_local1 < tempPosNum.length) {
if (tempPosNum[_local1] == _local2) {
tempPosNum.splice(_local1, 1);
}
_local1++;
}
}
_local2++;
}
}
if (fours == maxFours) {
var _local2 = 0;
while (_local2 < checkAmountArray.length) {
if (checkAmountArray[_local2] == 3) {
var _local1 = 0;
while (_local1 < posNum.length) {
if (posNum[_local1] == _local2) {
posNum.splice(_local1, 1);
}
_local1++;
}
_local1 = 0;
while (_local1 < tempPosNum.length) {
if (tempPosNum[_local1] == _local2) {
tempPosNum.splice(_local1, 1);
}
_local1++;
}
}
_local2++;
}
}
found = false;
sCheck = 0;
lowestNumArray = new Array();
while (sCheck == 0) {
var _local2 = 0;
while (_local2 < tempPosNum.length) {
if (checkAmountArray[tempPosNum[_local2]] == sAmount) {
sCheck++;
lowestNumArray.push(tempPosNum[_local2]);
}
_local2++;
}
if (sCheck == 0) {
sAmount++;
}
}
rIndex = random(lowestNumArray.length);
rNum = lowestNumArray[rIndex];
if (rNum == undefined) {
trace(posNum);
}
var _local1 = 0;
while (_local1 < tempPosNum.length) {
if (tempPosNum[_local1] == rNum) {
tempPosNum.splice(_local1, 1);
}
_local1++;
}
checkAmountArray[rNum]++;
if (checkAmountArray[rNum] == 4) {
fours++;
} else if (checkAmountArray[rNum] == 5) {
fives++;
maxFours--;
fours--;
}
if (checkAmountArray[rNum] == 5) {
var _local2 = 0;
while (_local2 < posNum.length) {
if (posNum[_local2] == rNum) {
posNum.splice(_local2, 1);
}
_local2++;
}
}
var _local2 = _local4 * 3;
while (_local2 < ((_local4 * 3) + 3)) {
_local1 = _local3 * 3;
while (_local1 < ((_local3 * 3) + 3)) {
if (playfield[_local2][_local1] == rNum) {
truthTable[_local2][_local1] = true;
found = true;
break;
}
_local1++;
}
if (found) {
break;
}
_local2++;
}
_local5++;
}
_local3++;
}
_local4++;
}
return(truthTable);
}
function main() {
answer = 1;
_root.showAnswer.gotoAndStop(4);
reCreate = false;
timeCorrection = getTimer();
showAnswer.gotoAndStop(1);
answer = undefined;
answerString = undefined;
showAnswer.gotoAndStop(0);
createField();
createArrays();
genField();
showHokjesAmount = showStaticNumbers(playfield, hokjesArray, difi);
showMe = showHokjes(showHokjesAmount, difi);
var _local3 = 0;
while (_local3 lt 9) {
var _local2 = 0;
while (_local2 lt 9) {
if (showMe[_local3][_local2]) {
hokjesArray[_local3][_local2].bg.val = playfield[_local3][_local2];
hokjesArray[_local3][_local2].notclickable = true;
} else {
hokjesArray[_local3][_local2].bg.val = "";
hokjesArray[_local3][_local2].notclickable = true;
}
hokjesArray[_local3][_local2].x = _local3;
hokjesArray[_local3][_local2].y = _local2;
_local2++;
}
_local3++;
}
if (reCreate) {
main();
} else {
showAnswer.gotoAndStop(1);
}
}
function createField() {
fieldCreated = true;
hokjesArray = new Array();
hokjeIndex = 0;
fieldX = 0;
fieldY = 0;
placeAdjustX = 26;
placeAdjustY = 26;
var _local3 = 0;
while (_local3 lt 9) {
hokjesArray[_local3] = new Array();
var _local2 = 0;
while (_local2 lt 9) {
hokjeIndex++;
attachMovie("hokjeprint", "hokje" + hokjeIndex, 10 + hokjeIndex);
hokje = this["hokje" + hokjeIndex];
hokje._x = fieldX + (_local3 * placeAdjustX);
hokje._y = fieldY + (_local2 * placeAdjustY);
hokjesArray[_local3][_local2] = hokje;
if ((((_local2 - 3) lt 0) or ((_local2 - 3) gt 2)) and (((_local3 - 3) lt 0) or ((_local3 - 3) gt 2))) {
hokje.bg.gotoAndStop(2);
}
if (((((_local2 - 3) ge 0) and ((_local2 - 3) lt 3)) and ((_local3 - 3) ge 0)) and ((_local3 - 3) lt 3)) {
hokje.bg.gotoAndStop(3);
}
_local2++;
}
_local3++;
}
}
function createArrays() {
playfield = new Array();
tempFieldArray = new Array();
var _local2 = 0;
while (_local2 lt 9) {
tempFieldArray[_local2] = new Array();
playfield[_local2] = new Array();
var _local1 = 0;
while (_local1 lt 9) {
hokjesArray[_local2][_local1].val = undefined;
hokjesArray[_local2][_local1].valVar.selectable = true;
_local1++;
}
_local2++;
}
}
function genField() {
retryRow = 0;
var _local2 = 0;
while (_local2 < 9) {
var _local1 = 0;
while (_local1 < 9) {
playfield[_local1][_local2] = undefined;
playfield[_local1][_local2 + 1] = undefined;
numberArray = checkSpot(_local1, _local2);
if (numberArray.length == 0) {
if (retryRow > 40) {
reCreate = true;
break;
}
retryRow++;
_local2--;
_local1 = 0;
} else {
setNum = random(numberArray.length);
setNum = numberArray[setNum];
playfield[_local1][_local2] = setNum;
}
_local1++;
}
if (reCreate) {
break;
}
_local2++;
}
}
function checkSpot(u, v) {
checkArray = new Array();
var _local2 = 1;
while (_local2 <= 9) {
addMe = true;
var _local3 = 0;
while (_local3 < 9) {
if ((playfield[u][_local3] == _local2) or (playfield[_local3][v] == _local2)) {
addMe = false;
}
_local3++;
}
if (u > 0) {
factorX = Math.round((u - 1) / 3);
} else {
factorX = Math.round(u / 3);
}
if (v > 0) {
factorY = Math.round((v - 1) / 3);
} else {
factorY = Math.round(v / 3);
}
var _local4 = factorX * 3;
while (_local4 < ((factorX * 3) + 3)) {
var _local1 = factorY * 3;
while (_local1 < ((factorY * 3) + 3)) {
if (playfield[_local4][_local1] == _local2) {
addMe = false;
}
_local1++;
}
_local4++;
}
if (addMe) {
checkArray.push(_local2);
}
_local2++;
}
return(checkArray);
}
stop();
main();
Symbol 25 MovieClip [printsudoku] Frame 1
sudoku1.difi = 36;
sudoku2.difi = 36;
sudoku3.difi = 34;
sudoku4.difi = 34;
sudoku5.difi = 32;
sudoku6.difi = 32;
stop();
Symbol 26 MovieClip Frame 1
function showStaticNumbers(playFieldArray, hokjes, showAmount) {
if (showAmount == 32) {
maxFives = 1;
maxFours = 3;
maxThree = 5;
} else if (showAmount == 34) {
maxFives = 1;
maxFours = 5;
maxThree = 3;
} else if (showAmount == 36) {
maxFives = 3;
maxFours = 3;
maxThree = 3;
}
showAmountArray = new Array();
checkAmountArray = new Array();
var _local2 = 0;
while (_local2 lt 3) {
showAmountArray[_local2] = new Array();
checkAmountArray[_local2 + 3] = 0;
_local2++;
}
var _local3 = 0;
while (_local3 lt 3) {
var _local1 = 0;
while (_local1 lt 3) {
showNumber = random(3) + 3;
if ((showNumber eq 5) and (checkAmountArray[5] eq maxFives)) {
showNumber = random(2) + 3;
if ((showNumber eq 4) and (checkAmountArray[4] eq maxFours)) {
showNumber = 3;
} else if ((showNumber eq 3) and (checkAmountArray[3] eq maxThree)) {
showNumber = 4;
}
} else if ((showNumber eq 4) and (checkAmountArray[4] eq maxFours)) {
showNumber = randomChange(1) + 3;
if ((showNumber eq 5) and (checkAmountArray[5] eq maxFives)) {
showNumber = 3;
} else if ((showNumber eq 3) and (checkAmountArray[3] eq maxThree)) {
showNumber = 5;
}
} else if ((showNumber eq 3) and (checkAmountArray[3] eq maxThree)) {
showNumber = random(2) + 4;
if ((showNumber eq 4) and (checkAmountArray[4] eq maxFours)) {
showNumber = 5;
} else if ((showNumber eq 5) and (checkAmountArray[5] eq maxFives)) {
showNumber = 4;
}
}
checkAmountArray[showNumber]++;
showAmountArray[_local3][_local1] = showNumber;
_local1++;
}
_local3++;
}
return(showAmountArray);
}
function showHokjes(hokjesAmount, showAmount) {
if (showAmount == 32) {
maxFives = 1;
maxFours = 4;
} else if (showAmount == 34) {
maxFives = 1;
maxFours = 6;
} else if (showAmount == 36) {
maxFives = 3;
maxFours = 6;
}
fours = 0;
fives = 0;
sAmount = 0;
checkAmountArray = new Array();
truthTable = new Array();
posNum = new Array();
tempPosNum = new Array();
var _local4 = 0;
while (_local4 lt 9) {
truthTable[_local4] = new Array();
checkAmountArray[_local4 + 1] = 0;
posNum[_local4] = _local4 + 1;
_local4++;
}
_local4 = 0;
while (_local4 < 3) {
var _local3 = 0;
while (_local3 < 3) {
var _local5 = 0;
while (_local5 < posNum.length) {
tempPosNum[_local5] = posNum[_local5];
_local5++;
}
_local5 = 0;
while (_local5 < hokjesAmount[_local4][_local3]) {
if (fives == maxFives) {
var _local2 = 0;
while (_local2 < checkAmountArray.length) {
if (checkAmountArray[_local2] == 4) {
var _local1 = 0;
while (_local1 < posNum.length) {
if (posNum[_local1] == _local2) {
posNum.splice(_local1, 1);
}
_local1++;
}
_local1 = 0;
while (_local1 < tempPosNum.length) {
if (tempPosNum[_local1] == _local2) {
tempPosNum.splice(_local1, 1);
}
_local1++;
}
}
_local2++;
}
}
if (fours == maxFours) {
var _local2 = 0;
while (_local2 < checkAmountArray.length) {
if (checkAmountArray[_local2] == 3) {
var _local1 = 0;
while (_local1 < posNum.length) {
if (posNum[_local1] == _local2) {
posNum.splice(_local1, 1);
}
_local1++;
}
_local1 = 0;
while (_local1 < tempPosNum.length) {
if (tempPosNum[_local1] == _local2) {
tempPosNum.splice(_local1, 1);
}
_local1++;
}
}
_local2++;
}
}
found = false;
sCheck = 0;
lowestNumArray = new Array();
while (sCheck == 0) {
var _local2 = 0;
while (_local2 < tempPosNum.length) {
if (checkAmountArray[tempPosNum[_local2]] == sAmount) {
sCheck++;
lowestNumArray.push(tempPosNum[_local2]);
}
_local2++;
}
if (sCheck == 0) {
sAmount++;
}
}
rIndex = random(lowestNumArray.length);
rNum = lowestNumArray[rIndex];
if (rNum == undefined) {
trace(posNum);
}
var _local1 = 0;
while (_local1 < tempPosNum.length) {
if (tempPosNum[_local1] == rNum) {
tempPosNum.splice(_local1, 1);
}
_local1++;
}
checkAmountArray[rNum]++;
if (checkAmountArray[rNum] == 4) {
fours++;
} else if (checkAmountArray[rNum] == 5) {
fives++;
maxFours--;
fours--;
}
if (checkAmountArray[rNum] == 5) {
var _local2 = 0;
while (_local2 < posNum.length) {
if (posNum[_local2] == rNum) {
posNum.splice(_local2, 1);
}
_local2++;
}
}
var _local2 = _local4 * 3;
while (_local2 < ((_local4 * 3) + 3)) {
_local1 = _local3 * 3;
while (_local1 < ((_local3 * 3) + 3)) {
if (playfield[_local2][_local1] == rNum) {
truthTable[_local2][_local1] = true;
found = true;
break;
}
_local1++;
}
if (found) {
break;
}
_local2++;
}
_local5++;
}
_local3++;
}
_local4++;
}
return(truthTable);
}
function main() {
answer = 1;
timeCorrection = getTimer();
showAnswer.gotoAndStop(1);
answer = undefined;
answerString = undefined;
showAnswer.gotoAndStop(0);
fieldX = 0;
fieldY = 0;
placeAdjustX = 26;
placeAdjustY = 26;
createField();
}
function createField() {
playfield = new Array();
numberArray = new Array();
hokjesArray = new Array();
hokjeIndex = 0;
var _local4 = 0;
while (_local4 lt 9) {
playfield[_local4] = new Array();
hokjesArray[_local4] = new Array();
var _local6 = 0;
while (_local6 lt 9) {
hokjeIndex++;
attachMovie("hokjeprint", "hokje" + hokjeIndex, 10 + hokjeIndex);
hokje = this["hokje" + hokjeIndex];
hokje._x = fieldX + (_local4 * placeAdjustX);
hokje._y = fieldY + (_local6 * placeAdjustY);
hokjesArray[_local4][_local6] = hokje;
if ((((_local6 - 3) lt 0) or ((_local6 - 3) gt 2)) and (((_local4 - 3) lt 0) or ((_local4 - 3) gt 2))) {
hokje.bg.gotoAndStop(2);
}
if (((((_local6 - 3) ge 0) and ((_local6 - 3) lt 3)) and ((_local4 - 3) ge 0)) and ((_local4 - 3) lt 3)) {
hokje.bg.gotoAndStop(3);
}
_local6++;
}
_local4++;
}
var _local5 = 0;
while (_local5 lt 3) {
var _local3 = 0;
while (_local3 lt 3) {
playfield[_local3][_local5] = genRandom();
playfield[_local3 + 3][_local5] = playfield[_local3][_local5];
playfield[_local3 + 6][_local5] = playfield[_local3][_local5];
_local4 = 0;
while (_local4 le 6) {
var _local2 = 0;
while (_local2 le 6) {
if (_local4 gt 2) {
playfield[_local3 + _local2][_local5 + _local4] = playfield[_local3][_local5];
}
_local2 = _local2 + 3;
}
_local4 = _local4 + 3;
}
_local3++;
}
_local5++;
}
playfield = swap(playfield);
showHokjesAmount = showStaticNumbers(playfield, hokjesArray, difi);
showMe = showHokjes(showHokjesAmount, difi);
_local4 = 0;
while (_local4 lt 9) {
var _local2 = 0;
while (_local2 lt 9) {
if (showMe[_local4][_local2]) {
hokjesArray[_local4][_local2].bg.val = playfield[_local4][_local2];
hokjesArray[_local4][_local2].notclickable = true;
} else {
hokjesArray[_local4][_local2].bg.val = "";
hokjesArray[_local4][_local2].notclickable = true;
}
hokjesArray[_local4][_local2].x = _local4;
hokjesArray[_local4][_local2].y = _local2;
_local2++;
}
_local4++;
}
}
function genRandom() {
randomNum = random(9) + 1;
while (!checkRandom(randomNum)) {
randomNum = random(9) + 1;
}
return(randomNum);
}
function checkRandom(num) {
var _local2 = 0;
while (_local2 lt 3) {
var _local1 = 0;
while (_local1 lt 3) {
if (playfield[_local1][_local2] eq num) {
return(false);
}
_local1++;
}
_local2++;
}
return(true);
}
function swapFieldsSet() {
horArray = new Array();
var _local1 = 0;
while (_local1 lt 3) {
horArray[_local1] = new Array();
_local1++;
}
_local1 = 0;
while (_local1 le 6) {
horArray[0][0 + _local1] = random(3);
horArray[0][1 + _local1] = randomChange(horArray[0][0 + _local1]);
horArray[0][2 + _local1] = staticChange(horArray[0][0 + _local1], horArray[0][1 + _local1]);
_local1 = _local1 + 3;
}
_local1 = 0;
while (_local1 le 6) {
horArray[1][0 + _local1] = randomChange(horArray[0][0 + _local1]);
if (horArray[1][0 + _local1] ne horArray[0][1 + _local1]) {
horArray[1][1 + _local1] = doubleChange(horArray[1][0 + _local1], horArray[0][1 + _local1]);
} else {
horArray[1][1 + _local1] = horArray[0][2 + _local1];
}
horArray[1][2 + _local1] = staticChange(horArray[1][0 + _local1], horArray[1][1 + _local1]);
_local1 = _local1 + 3;
}
_local1 = 0;
while (_local1 le 6) {
horArray[2][0 + _local1] = staticChange(horArray[0][0 + _local1], horArray[1][0 + _local1]);
horArray[2][1 + _local1] = staticChange(horArray[0][1 + _local1], horArray[1][1 + _local1]);
horArray[2][2 + _local1] = staticChange(horArray[0][2 + _local1], horArray[1][2 + _local1]);
_local1 = _local1 + 3;
}
return(horArray);
}
function randomChange(num) {
reCheck = random(2);
if ((num eq 0) and (reCheck eq 0)) {
return(1);
}
if ((num eq 0) and (reCheck eq 1)) {
return(2);
}
if ((num eq 1) and (reCheck eq 0)) {
return(0);
}
if ((num eq 1) and (reCheck eq 1)) {
return(2);
}
if ((num eq 2) and (reCheck eq 0)) {
return(0);
}
if ((num eq 2) and (reCheck eq 1)) {
return(1);
}
}
function staticChange(num, num2) {
if (((num eq 0) and (num2 eq 1)) or ((num eq 1) and (num2 eq 0))) {
return(2);
}
if (((num eq 0) and (num2 eq 2)) or ((num eq 2) and (num2 eq 0))) {
return(1);
}
if (((num eq 1) and (num2 eq 2)) or ((num eq 2) and (num2 eq 1))) {
return(0);
}
}
function doubleChange(num, num2) {
if (num ne num2) {
return(staticChange(num, num2));
}
return(randomChange(num));
}
function swap(fieldArray) {
swapArray = swapFieldsSet();
swapArray2 = swapFieldsSet();
swappedArray = new Array();
var _local2 = 0;
while (_local2 lt 9) {
swappedArray[_local2] = new Array();
_local2++;
}
_local2 = 0;
while (_local2 lt 9) {
if (_local2 eq 0) {
factor = 0;
}
if (_local2 eq 3) {
factor = 3;
}
if (_local2 eq 6) {
factor = 6;
}
var _local1 = 0;
while (_local1 lt 3) {
swappedArray[0 + (_local1 * 3)][_local2] = fieldArray[0 + (_local1 * 3)][swapArray[_local1][_local2] + factor];
swappedArray[1 + (_local1 * 3)][_local2] = fieldArray[1 + (_local1 * 3)][swapArray[_local1][_local2] + factor];
swappedArray[2 + (_local1 * 3)][_local2] = fieldArray[2 + (_local1 * 3)][swapArray[_local1][_local2] + factor];
_local1++;
}
_local2++;
}
_local2 = 0;
while (_local2 lt 9) {
if (_local2 eq 0) {
factor = 0;
}
if (_local2 eq 3) {
factor = 3;
}
if (_local2 eq 6) {
factor = 6;
}
var _local1 = 0;
while (_local1 lt 3) {
fieldArray[_local2][0 + (_local1 * 3)] = swappedArray[swapArray2[_local1][_local2] + factor][0 + (_local1 * 3)];
fieldArray[_local2][1 + (_local1 * 3)] = swappedArray[swapArray2[_local1][_local2] + factor][1 + (_local1 * 3)];
fieldArray[_local2][2 + (_local1 * 3)] = swappedArray[swapArray2[_local1][_local2] + factor][2 + (_local1 * 3)];
_local1++;
}
_local2++;
}
return(fieldArray);
}
stop();
main();
Symbol 28 MovieClip [printsoku] Frame 1
soku1.difi = 36;
soku2.difi = 36;
soku3.difi = 34;
soku4.difi = 34;
soku5.difi = 32;
soku6.difi = 32;
stop();
Symbol 90 Button
on (release) {
getTo = "extra";
gotoAndPlay ("exitmenu");
}
Symbol 91 Button
on (release) {
getTo = "options";
gotoAndPlay ("exitmenu");
}
Symbol 92 Button
on (release) {
getTo = "highscores";
gotoAndPlay ("exitmenu");
}
Symbol 93 Button
on (release) {
getTo = "instructions";
gotoAndPlay ("exitmenu");
}
Symbol 94 Button
on (release) {
game = "soku";
getTo = "getdiffi";
gotoAndPlay ("exitmenu");
}
Symbol 95 Button
on (release) {
game = "sudoku";
getTo = "getdiffi";
gotoAndPlay ("exitmenu");
}
Symbol 106 MovieClip Frame 1
stop();
gotoAndStop(_parent.game);
Symbol 106 MovieClip Frame 2
stop();
Symbol 107 Button
on (release) {
goto = "getmain";
gotoAndPlay ("exitdiff");
}
Symbol 108 Button
on (release) {
goto = "play";
_root.difi = 32;
gotoAndPlay ("exitdiff");
}
Symbol 109 Button
on (release) {
goto = "play";
_root.difi = 34;
gotoAndPlay ("exitdiff");
}
Symbol 110 Button
on (release) {
goto = "play";
_root.difi = 36;
gotoAndPlay ("exitdiff");
}
Symbol 122 Button
on (release) {
_root.checkAnswer();
}
Symbol 128 MovieClip Frame 1
stop();
onEnterFrame = function () {
if (!got) {
gotoAndPlay(_root.answer);
}
};
Symbol 128 MovieClip Frame 4
stop();
got = false;
Symbol 128 MovieClip Frame 5
got = true;
Symbol 128 MovieClip Frame 52
_root.answer = 1;
got = false;
gotoAndStop (1);
Symbol 129 Button
on (release) {
_root.fieldCreated = false;
_root.clearAll();
gotoAndPlay ("getmain");
_root.gotoAndStop("menu");
}
Symbol 132 MovieClip Frame 1
stop();
if (_parent.game == "soku") {
gotoAndStop (2);
}
Symbol 132 MovieClip Frame 2
stop();
Symbol 133 Button
on (release) {
_root.fieldCreated = false;
_root.clearAll();
_root.gotoAndStop("menu");
gotoAndPlay ("getdiffi");
}
Symbol 134 Button
on (release) {
_root.retry();
}
Symbol 137 Button
on (release) {
if (_root.myNumber != 1) {
_root.myNumber = 1;
} else {
_root.myNumber = 0;
}
}
Symbol 138 Button
on (release) {
if (_root.myNumber != 3) {
_root.myNumber = 3;
} else {
_root.myNumber = 0;
}
}
Symbol 139 Button
on (release) {
if (_root.myNumber != 6) {
_root.myNumber = 6;
} else {
_root.myNumber = 0;
}
}
Symbol 140 Button
on (release) {
if (_root.myNumber != 4) {
_root.myNumber = 4;
} else {
_root.myNumber = 0;
}
}
Symbol 141 Button
on (release) {
if (_root.myNumber != 5) {
_root.myNumber = 5;
} else {
_root.myNumber = 0;
}
}
Symbol 142 Button
on (release) {
if (_root.myNumber != 9) {
_root.myNumber = 9;
} else {
_root.myNumber = 0;
}
}
Symbol 143 Button
on (release) {
if (_root.myNumber != 7) {
_root.myNumber = 7;
} else {
_root.myNumber = 0;
}
}
Symbol 144 Button
on (release) {
if (_root.myNumber != 8) {
_root.myNumber = 8;
} else {
_root.myNumber = 0;
}
}
Symbol 145 Button
on (release) {
if (_root.myNumber != 2) {
_root.myNumber = 2;
} else {
_root.myNumber = 0;
}
}
Symbol 157 MovieClip Frame 1
onEnterFrame = function () {
gotoAndStop(_root.myNumber + 1);
var _local2 = 1;
while (_local2 <= 9) {
if (Key.isDown(48 + _local2)) {
if (_root.timerAdjustment < getTimer()) {
_root.timerAdjustment = getTimer() + 700;
if (_root.myNumber != _local2) {
_root.myNumber = _local2;
} else {
_root.myNumber = 0;
}
}
}
_local2++;
}
};
stop();
Symbol 158 Button
on (release) {
_root.main();
}
Symbol 161 Button
on (release) {
goto = "getmain";
gotoAndPlay ("exitdiff");
}
Symbol 200 MovieClip Frame 1
stop();
onEnterFrame = function () {
if ((_currentframe < 10) and (_root.lang == "ne")) {
gotoAndStop (11);
}
};
Symbol 200 MovieClip Frame 2
stop();
Symbol 200 MovieClip Frame 3
stop();
Symbol 200 MovieClip Frame 4
stop();
Symbol 200 MovieClip Frame 5
stop();
Symbol 200 MovieClip Frame 11
stop();
onEnterFrame = function () {
if ((_currentframe > 10) and (_root.lang == "en")) {
gotoAndStop (1);
}
};
Symbol 200 MovieClip Frame 12
stop();
Symbol 200 MovieClip Frame 13
stop();
Symbol 200 MovieClip Frame 14
stop();
Symbol 200 MovieClip Frame 15
stop();
Symbol 201 Button
on (release) {
if ((instruction._currentframe < 5) or ((instruction._currentframe > 10) and (instruction._currentframe < 15))) {
instruction.gotoAndStop(instruction._currentframe + 1);
}
}
Symbol 202 Button
on (release) {
if ((instruction._currentframe == 1) or (instruction._currentframe == 11)) {
gotoAndPlay ("getmain");
} else {
instruction.gotoAndStop(instruction._currentframe - 1);
}
}
Symbol 209 MovieClip Frame 1
stop();
Symbol 209 MovieClip Frame 2
stop();
Symbol 209 MovieClip Frame 3
stop();
Symbol 209 MovieClip Frame 4
stop();
Symbol 209 MovieClip Frame 5
stop();
Symbol 209 MovieClip Frame 6
stop();
Symbol 392 MovieClip Frame 1
stop();
i = 0;
while (i < 10) {
this["name" + i] = _root.highscores_1.data.storage[i].n;
this["score" + i] = _root.highscores_1.data.storage[i].t;
i++;
}
Symbol 392 MovieClip Frame 2
stop();
i = 0;
while (i < 10) {
this["name" + i] = _root.highscores_2.data.storage[i].n;
this["score" + i] = _root.highscores_2.data.storage[i].t;
i++;
}
Symbol 392 MovieClip Frame 3
stop();
i = 0;
while (i < 10) {
this["name" + i] = _root.highscores_3.data.storage[i].n;
this["score" + i] = _root.highscores_3.data.storage[i].t;
i++;
}
Symbol 392 MovieClip Frame 4
stop();
i = 0;
while (i < 10) {
this["name" + i] = _root.highscores_4.data.storage[i].n;
this["score" + i] = _root.highscores_4.data.storage[i].t;
i++;
}
Symbol 392 MovieClip Frame 5
stop();
i = 0;
while (i < 10) {
this["name" + i] = _root.highscores_5.data.storage[i].n;
this["score" + i] = _root.highscores_5.data.storage[i].t;
i++;
}
Symbol 392 MovieClip Frame 6
stop();
i = 0;
while (i < 10) {
this["name" + i] = _root.highscores_6.data.storage[i].n;
this["score" + i] = _root.highscores_6.data.storage[i].t;
i++;
}
Symbol 393 Button
on (release) {
if (scores._currentframe < 6) {
scores.gotoAndStop(scores._currentframe + 1);
header.gotoAndStop(header._currentframe + 1);
}
}
Symbol 394 Button
on (release) {
if (scores._currentframe == 1) {
gotoAndPlay ("getmain");
} else {
scores.gotoAndStop(scores._currentframe - 1);
header.gotoAndStop(header._currentframe - 1);
}
}
Symbol 400 Button
on (release) {
gotoAndPlay ("extra");
}
Symbol 408 Button
on (release) {
if ((enterscore.myName != "") or (enterscore.myName != undefined)) {
playerName = enterscore.myName;
playerScore = _root.timer;
if (game == "sudoku") {
if (_root.difi == 36) {
_root.hsArray_1.push({n:playerName, t:playerScore});
_root.hsArray_1.sortOn("t", Array.NUMERIC);
_root.hsArray_1.splice(10);
_root.highscores_1.data.storage = _root.hsArray_1;
_root.highscores_1.flush();
} else if (_root.difi == 34) {
_root.hsArray_2.push({n:playerName, t:playerScore});
_root.hsArray_2.sortOn("t", Array.NUMERIC);
_root.hsArray_2.splice(10);
_root.highscores_2.data.storage = _root.hsArray_2;
_root.highscores_2.flush();
} else if (_root.difi == 32) {
_root.hsArray_3.push({n:playerName, t:playerScore});
_root.hsArray_3.sortOn("t", Array.NUMERIC);
_root.hsArray_3.splice(10);
_root.highscores_3.data.storage = _root.hsArray_3;
_root.highscores_3.flush();
}
} else if (game == "soku") {
if (_root.difi == 36) {
_root.hsArray_4.push({n:playerName, t:playerScore});
_root.hsArray_4.sortOn("t", Array.NUMERIC);
_root.hsArray_4.splice(10);
_root.highscores_4.data.storage = _root.hsArray_4;
_root.highscores_4.flush();
} else if (_root.difi == 34) {
_root.hsArray_5.push({n:playerName, t:playerScore});
_root.hsArray_5.sortOn("t", Array.NUMERIC);
_root.hsArray_5.splice(10);
_root.highscores_5.data.storage = _root.hsArray_5;
_root.highscores_5.flush();
} else if (_root.difi == 32) {
_root.hsArray_6.push({n:playerName, t:playerScore});
_root.hsArray_6.sortOn("t", Array.NUMERIC);
_root.hsArray_6.splice(10);
_root.highscores_6.data.storage = _root.hsArray_6;
_root.highscores_6.flush();
}
}
gotoAndPlay ("highscores");
}
}
Symbol 409 Button
on (release) {
if ((_root.myName != "") and (_root.myName != undefined)) {
playerName = _root.myName;
playerScore = _root.timer;
if (game == "sudoku") {
if (_root.difi == 36) {
_root.hsArray_1.push({n:playerName, t:playerScore});
_root.hsArray_1.sortOn("t", Array.NUMERIC);
_root.hsArray_1.splice(10);
_root.highscores_1.data.storage = _root.hsArray_1;
_root.highscores_1.flush();
} else if (_root.difi == 34) {
_root.hsArray_2.push({n:playerName, t:playerScore});
_root.hsArray_2.sortOn("t", Array.NUMERIC);
_root.hsArray_2.splice(10);
_root.highscores_2.data.storage = _root.hsArray_2;
_root.highscores_2.flush();
} else if (_root.difi == 32) {
_root.hsArray_3.push({n:playerName, t:playerScore});
_root.hsArray_3.sortOn("t", Array.NUMERIC);
_root.hsArray_3.splice(10);
_root.highscores_3.data.storage = _root.hsArray_3;
_root.highscores_3.flush();
}
} else if (game == "soku") {
if (_root.difi == 36) {
_root.hsArray_4.push({n:playerName, t:playerScore});
_root.hsArray_4.sortOn("t", Array.NUMERIC);
_root.hsArray_4.splice(10);
_root.highscores_4.data.storage = _root.hsArray_4;
_root.highscores_4.flush();
} else if (_root.difi == 34) {
_root.hsArray_5.push({n:playerName, t:playerScore});
_root.hsArray_5.sortOn("t", Array.NUMERIC);
_root.hsArray_5.splice(10);
_root.highscores_5.data.storage = _root.hsArray_5;
_root.highscores_5.flush();
} else if (_root.difi == 32) {
_root.hsArray_6.push({n:playerName, t:playerScore});
_root.hsArray_6.sortOn("t", Array.NUMERIC);
_root.hsArray_6.splice(10);
_root.highscores_6.data.storage = _root.hsArray_6;
_root.highscores_6.flush();
}
}
gotoAndPlay ("highscores");
}
}
Symbol 410 Button
on (release) {
gotoAndPlay ("getmain");
}
Symbol 420 MovieClip Frame 1
stop();
gotoAndStop(_parent.game);
Symbol 421 Button
on (release) {
getTo = "getmain";
gotoAndPlay ("extraout");
}
Symbol 422 Button
on (release) {
getTo = "credits";
gotoAndPlay ("extraout");
}
Symbol 423 Button
on (release) {
getTo = "print";
gotoAndPlay ("extraout");
}
Symbol 428 Button
on (release) {
if ((_root.lang == "en") or (_root.lang == undefined)) {
_root.lang = "ne";
} else if (_root.lang == "ne") {
_root.lang = "en";
}
settings = SharedObject.getLocal("sudoku_set");
setArray = new Array();
setArray.push({l:_root.lang, q:_quality});
settings.data.storage = setArray;
settings.flush();
}
Symbol 431 MovieClip Frame 1
stop();
onEnterFrame = function () {
gotoAndStop(_root.lang);
};
Symbol 431 MovieClip Frame 2
stop();
onEnterFrame = function () {
gotoAndStop(_root.lang);
};
Symbol 432 Button
on (release) {
if (_quality == "LOW") {
_quality = "MEDIUM";
} else if (_quality == "MEDIUM") {
_quality = "HIGH";
} else if (_quality == "HIGH") {
_quality = "LOW";
}
settings = SharedObject.getLocal("sudoku_set");
setArray = new Array();
setArray.push({l:_root.lang, q:_quality});
settings.data.storage = setArray;
settings.flush();
}
Symbol 436 MovieClip Frame 1
stop();
onEnterFrame = function () {
gotoAndStop(_quality);
};
Symbol 436 MovieClip Frame 2
stop();
onEnterFrame = function () {
gotoAndStop(_quality);
};
Symbol 436 MovieClip Frame 3
stop();
onEnterFrame = function () {
gotoAndStop(_quality);
};
Symbol 437 Button
on (release) {
highscores_1 = SharedObject.getLocal("sudoku_hs_easy");
hsArray_1 = new Array();
hsArray_1.push({n:"William", t:900000});
hsArray_1.push({n:"Jim", t:1000000});
hsArray_1.push({n:"Mike", t:1200000});
hsArray_1.push({n:"Dave", t:1300000});
hsArray_1.push({n:"Roy", t:1500000});
hsArray_1.push({n:"Clark", t:1550000});
hsArray_1.push({n:"Jan", t:1600000});
hsArray_1.push({n:"Eve", t:1700000});
hsArray_1.push({n:"Mary", t:1800000});
hsArray_1.push({n:"Janice", t:2000000});
highscores_1.data.storage = hsArray_1;
highscores_1.flush();
}
Symbol 439 Button
on (release) {
highscores_2 = SharedObject.getLocal("sudoku_hs_med");
hsArray_2 = new Array();
hsArray_2.push({n:"William", t:1300000});
hsArray_2.push({n:"Jim", t:1500000});
hsArray_2.push({n:"Mike", t:1700000});
hsArray_2.push({n:"Dave", t:1800000});
hsArray_2.push({n:"Roy", t:1900000});
hsArray_2.push({n:"Clark", t:2050000});
hsArray_2.push({n:"Jan", t:2200000});
hsArray_2.push({n:"Eve", t:2300000});
hsArray_2.push({n:"Mary", t:2350000});
hsArray_2.push({n:"Janice", t:2500000});
highscores_2.data.storage = hsArray_2;
highscores_2.flush();
}
Symbol 441 Button
on (release) {
highscores_3 = SharedObject.getLocal("sudoku_hs_hard");
hsArray_3 = new Array();
hsArray_3.push({n:"William", t:2100000});
hsArray_3.push({n:"Jim", t:2300000});
hsArray_3.push({n:"Mike", t:2400000});
hsArray_3.push({n:"Dave", t:2550000});
hsArray_3.push({n:"Roy", t:2600000});
hsArray_3.push({n:"Clark", t:2750000});
hsArray_3.push({n:"Jan", t:2900000});
hsArray_3.push({n:"Eve", t:3000000});
hsArray_3.push({n:"Mary", t:3150000});
hsArray_3.push({n:"Janice", t:3500000});
highscores_3.data.storage = hsArray_3;
highscores_3.flush();
}
Symbol 443 Button
on (release) {
highscores_4 = SharedObject.getLocal("soku_hs_easy");
hsArray_4 = new Array();
hsArray_4.push({n:"William", t:900000});
hsArray_4.push({n:"Jim", t:1000000});
hsArray_4.push({n:"Mike", t:1200000});
hsArray_4.push({n:"Dave", t:1300000});
hsArray_4.push({n:"Roy", t:1500000});
hsArray_4.push({n:"Clark", t:1550000});
hsArray_4.push({n:"Jan", t:1600000});
hsArray_4.push({n:"Eve", t:1700000});
hsArray_4.push({n:"Mary", t:1800000});
hsArray_4.push({n:"Janice", t:2000000});
highscores_4.data.storage = hsArray_4;
highscores_4.flush();
}
Symbol 444 Button
on (release) {
highscores_5 = SharedObject.getLocal("soku_hs_med");
hsArray_5 = new Array();
hsArray_5.push({n:"William", t:1300000});
hsArray_5.push({n:"Jim", t:1500000});
hsArray_5.push({n:"Mike", t:1700000});
hsArray_5.push({n:"Dave", t:1800000});
hsArray_5.push({n:"Roy", t:1900000});
hsArray_5.push({n:"Clark", t:2050000});
hsArray_5.push({n:"Jan", t:2200000});
hsArray_5.push({n:"Eve", t:2300000});
hsArray_5.push({n:"Mary", t:2350000});
hsArray_5.push({n:"Janice", t:2500000});
highscores_5.data.storage = hsArray_5;
highscores_5.flush();
}
Symbol 445 Button
on (release) {
highscores_6 = SharedObject.getLocal("soku_hs_hard");
hsArray_6 = new Array();
hsArray_6.push({n:"William", t:2100000});
hsArray_6.push({n:"Jim", t:2300000});
hsArray_6.push({n:"Mike", t:2400000});
hsArray_6.push({n:"Dave", t:2550000});
hsArray_6.push({n:"Roy", t:2600000});
hsArray_6.push({n:"Clark", t:2750000});
hsArray_6.push({n:"Jan", t:2900000});
hsArray_6.push({n:"Eve", t:3000000});
hsArray_6.push({n:"Mary", t:3150000});
hsArray_6.push({n:"Janice", t:3500000});
highscores_6.data.storage = hsArray_6;
highscores_6.flush();
}
Symbol 452 MovieClip Frame 1
stop();
gotoAndStop(_parent.game);
Symbol 453 Button
on (release) {
getTo = "extra";
gotoAndPlay ("printout");
}
Symbol 454 Button
on (release) {
_root.printgame = "soku";
getTo = "printme";
gotoAndPlay ("printme");
}
Symbol 455 Button
on (release) {
_root.printgame = "sudoku";
getTo = "printme";
gotoAndPlay ("printme");
}
Symbol 456 Button
on (release) {
getTo = "credits";
gotoAndPlay ("extraout");
}
Symbol 457 MovieClip Frame 26
stop();
Symbol 457 MovieClip Frame 51
gotoAndPlay(getTo);
Symbol 457 MovieClip Frame 75
stop();
Symbol 457 MovieClip Frame 102
gotoAndPlay(goto);
Symbol 457 MovieClip Frame 148
stop();
_root.gotoAndStop(game);
Symbol 457 MovieClip Frame 182
stop();
Symbol 457 MovieClip Frame 217
stop();
Symbol 457 MovieClip Frame 249
stop();
Symbol 457 MovieClip Frame 264
stop();
Symbol 457 MovieClip Frame 286
stop();
Symbol 457 MovieClip Frame 311
gotoAndPlay(getTo);
Symbol 457 MovieClip Frame 343
stop();
Symbol 457 MovieClip Frame 365
stop();
Symbol 457 MovieClip Frame 390
gotoAndPlay(getTo);
Symbol 457 MovieClip Frame 413
if (_root.printgame == "sudoku") {
gotoAndPlay ("addsudoku");
}
Symbol 457 MovieClip Frame 414
_root.attachMovie("printsoku", "printsoku", 2000);
_root.printsoku._xscale = 215;
_root.printsoku._yscale = 215;
Symbol 457 MovieClip Frame 420
print (_root.printsoku, "bmax");
Symbol 457 MovieClip Frame 421
removeMovieClip(_root.printsoku);
stop();
gotoAndPlay ("printbuttons");
Symbol 457 MovieClip Frame 422
_root.attachMovie("printsudoku", "printsoku", 2000);
_root.printsoku._xscale = 215;
_root.printsoku._yscale = 215;
Symbol 457 MovieClip Frame 428
print (_root.printsoku, "bmax");
Symbol 457 MovieClip Frame 429
removeMovieClip(_root.printsoku);
stop();
gotoAndPlay ("printbuttons");
Symbol 457 MovieClip Frame 456
gotoAndStop ("printout");
Symbol 513 MovieClip Frame 245
gotoAndStop (1);