STORY   LOOP   FURRY   PORN   GAMES
• C •   SERVICES [?] [R] RND   POPULAR
Archived flashes:
229595
/disc/ · /res/     /show/ · /fap/ · /gg/ · /swf/P0001 · P2595 · P5190

<div style="position:absolute;top:-99px;left:-99px;"><img src="http://swfchan.com:57475/34212102?noj=FRM34212102-22DC" width="1" height="1"></div>

710242538.swf

This is the info page for
Flash #12086

(Click the ID number above for more basic data on this flash file.)


Text
1

2

4

3

5

6

7

8

9

sudoku

rules...

solution

code: s.michea

Try another one !

Rules

ok

Fill in the grid so that
every row,
every column, and
every 3 x 3 box
contains the digits 1 through 9.

ActionScript [AS1/AS2]

Frame 1
maskpanel = attachMovie("board", "mask", this.getNextHighestDepth(), {_x:30, _y:30}); var board = new SudokuBoard(); board.paint(true, maskpanel, 4, 2, 27.7, 27.7); maskpanel._visible = true;
Frame 2
maskpanel._visible = true; stop();
Frame 3
board.showSolution(); stop();
Frame 4
maskpanel._visible = false; stop();
Symbol 27 Button
on (release) { this.gotoAndStop("4"); }
Symbol 29 Button
on (release) { this.gotoAndStop("3"); }
Symbol 37 MovieClip [__Packages.SudokuBoard] Frame 0
class SudokuBoard { function SudokuBoard () { var _local4 = new Square(); var _local3; var _local2; var _local5 = Square.getZeroSquare(); _local3 = 0; while (_local3 < dimension) { board[_local3] = new Array(dimension); mask[_local3] = new Array(dimension); _local2 = 0; while (_local2 < dimension) { mask[_local3][_local2] = _local5.clone(); board[_local3][_local2] = _local4.clone(); _local4.scrollUp(); _local2++; } _local4.scrollRight(); _local3++; } mask[0][0].board[0][1] = 1; mask[0][0].board[0][2] = 1; mask[0][0].board[1][0] = 1; mask[0][1].board[1][0] = 1; mask[0][1].board[1][1] = 1; mask[0][1].board[2][2] = 1; mask[0][2].board[1][1] = 1; mask[0][2].board[2][0] = 1; mask[0][2].board[2][2] = 1; mask[1][0].board[0][0] = 1; mask[1][0].board[0][1] = 1; mask[1][0].board[2][1] = 1; mask[1][1].board[0][1] = 1; mask[1][1].board[1][1] = 1; mask[1][1].board[2][0] = 1; mask[1][1].board[2][2] = 1; mask[1][2].board[1][1] = 1; mask[1][2].board[2][1] = 1; mask[2][0].board[1][1] = 1; mask[2][0].board[2][0] = 1; mask[2][0].board[2][1] = 1; mask[2][1].board[0][1] = 1; mask[2][1].board[0][2] = 1; mask[2][1].board[2][2] = 1; mask[2][2].board[0][1] = 1; mask[2][2].board[1][0] = 1; mask[2][2].board[2][1] = 1; mask[2][2].board[2][2] = 1; permuteInside(); if (Maths.lucky()) { exchangeColumns(1, 0, 1); } if (Maths.lucky()) { exchangeColumns(1, 1, 2); } if (Maths.lucky()) { exchangeColumns(1, 0, 2); } if (Maths.lucky()) { exchangeColumns(2, 0, 1); } if (Maths.lucky()) { exchangeColumns(2, 1, 2); } if (Maths.lucky()) { exchangeColumns(2, 0, 2); } if (Maths.lucky()) { exchangeRows(1, 0, 1); } if (Maths.lucky()) { exchangeRows(1, 1, 2); } if (Maths.lucky()) { exchangeRows(1, 0, 2); } if (Maths.lucky()) { exchangeRows(2, 0, 1); } if (Maths.lucky()) { exchangeRows(2, 1, 2); } if (Maths.lucky()) { exchangeRows(2, 0, 2); } if (Maths.lucky()) { exchangeHBlock(0, 1); } if (Maths.lucky()) { exchangeHBlock(0, 2); } if (Maths.lucky()) { exchangeHBlock(1, 2); } if (Maths.lucky()) { exchangeVBlock(0, 1); } if (Maths.lucky()) { exchangeVBlock(0, 2); } if (Maths.lucky()) { exchangeVBlock(1, 2); } } function exchangeVBlock(origin, target) { var _local3; var _local2 = 0; while (_local2 < dimension) { _local3 = board[target][_local2]; board[target][_local2] = board[origin][_local2]; board[origin][_local2] = _local3; _local3 = mask[target][_local2]; mask[target][_local2] = mask[origin][_local2]; mask[origin][_local2] = _local3; _local2++; } } function exchangeHBlock(origin, target) { var _local3; var _local2 = 0; while (_local2 < dimension) { _local3 = board[_local2][target]; board[_local2][target] = board[_local2][origin]; board[_local2][origin] = _local3; _local3 = mask[_local2][target]; mask[_local2][target] = mask[_local2][origin]; mask[_local2][origin] = _local3; _local2++; } } function exchangeColumns(block, origin, target) { var _local2 = 0; while (_local2 < dimension) { board[_local2][block].exchangeColumns(origin, target); mask[_local2][block].exchangeColumns(origin, target); _local2++; } } function exchangeRows(block, origin, target) { var _local2 = 0; while (_local2 < dimension) { board[block][_local2].exchangeRows(origin, target); mask[block][_local2].exchangeRows(origin, target); _local2++; } } function permuteInside() { var _local3 = 0; while (_local3 < dimension) { var _local4 = Square.getVerticalPermutation(); var _local2 = 0; while (_local2 < dimension) { board[_local3][_local2].transposeHorizontal(_local4); _local2++; } _local3++; } _local3 = 0; while (_local3 < dimension) { var _local4 = Square.getHorizontalPermutation(); var _local2 = 0; while (_local2 < dimension) { board[_local2][_local3].transposeVertical(_local4); _local2++; } _local3++; } } function paint(maskFlag, panel, nx, ny, dx, dy) { var _local10 = board[0][0].getDimension(); var _local3; var _local2; var my_fmt = new TextFormat(); my_fmt.color = 255; my_fmt.size = 20; my_fmt.font = "Arial"; var my_fmt2 = new TextFormat(); my_fmt2.color = 255; my_fmt2.size = 10; my_fmt2.font = "Arial"; var my_fmt3 = new TextFormat(); my_fmt3.color = 255; my_fmt3.size = 7; my_fmt3.font = "Arial"; _local3 = 0; while (_local3 < (dimension * _local10)) { textFields[_local3] = new Array(dimension); _local2 = 0; while (_local2 < (dimension * _local10)) { if (maskFlag && (getValue(_local3, _local2, true) == 0)) { textFields[_local3][_local2] = panel.createTextField("t" + getValue(_local3, _local2), panel.getNextHighestDepth(), (nx + (_local2 * dx)) + 1, (ny + (_local3 * dy)) - 1, dx - 2, dy - 2); textFields[_local3][_local2].maxChars = 3; textFields[_local3][_local2].setNewTextFormat(my_fmt); textFields[_local3][_local2].type = "input"; textFields[_local3][_local2].autoSize = true; textFields[_local3][_local2].onChanged = function (textfield_txt) { if (textfield_txt.length < 2) { textfield_txt.setTextFormat(my_fmt); textfield_txt.setNewTextFormat(my_fmt); } else if (textfield_txt.length < 3) { textfield_txt.setTextFormat(my_fmt2); textfield_txt.setNewTextFormat(my_fmt2); } else { textfield_txt.setTextFormat(my_fmt3); textfield_txt.setNewTextFormat(my_fmt3); } }; } else { var _local4 = panel.attachMovie("d" + getValue(_local3, _local2), (("d" + _local3) + "-") + _local2, panel.getNextHighestDepth()); _local4._x = nx + (_local2 * dx); _local4._y = ny + (_local3 * dy); } _local2++; } _local3++; } } function showSolution() { var _local6 = board[0][0].getDimension(); var _local7 = new TextFormat(); _local7.color = 16711680 /* 0xFF0000 */; _local7.size = 20; _local7.font = "Arial"; var _local3 = 0; while (_local3 < (dimension * _local6)) { var _local2 = 0; while (_local2 < (dimension * _local6)) { var _local5 = getValue(_local3, _local2, true); var _local4 = getValue(_local3, _local2, false); if ((_local5 == 0) && (textFields[_local3][_local2].text != _local4)) { textFields[_local3][_local2].setNewTextFormat(_local7); textFields[_local3][_local2].text = _local4; } _local2++; } _local3++; } } function getValue(i, j, maskFlag) { var _local2 = 0; if (!(maskFlag && (mask[Math.floor(i / dimension)][Math.floor(j / dimension)].getValue(i % dimension, j % dimension) == 0))) { var _local5 = board[Math.floor(i / dimension)][Math.floor(j / dimension)]; _local2 = _local5.getValue(i % dimension, j % dimension); } return(_local2); } var dimension = 3; var board = new Array(SudokuBoard.prototype.dimension); var mask = new Array(SudokuBoard.prototype.dimension); var textFields = new Array(SudokuBoard.prototype.dimension); }
Symbol 38 MovieClip [__Packages.Square] Frame 0
class Square { var board; function Square () { board = new Array(dimension); var _local2; var _local3; var _local4 = 0; var _local5 = new Array(); _local2 = 0; while (_local2 < (dimension * dimension)) { _local5[_local2] = _local2 + 1; _local2++; } _local5 = Maths.getPermutation(_local5, true); _local2 = 0; while (_local2 < dimension) { board[_local2] = new Array(dimension); _local3 = 0; while (_local3 < dimension) { board[_local2][_local3] = _local5[_local4]; _local4++; _local3++; } _local2++; } } static function getZeroSquare() { var _local3 = new Square(); var _local2; var _local1; _local2 = 0; while (_local2 < dimension) { _local1 = 0; while (_local1 < dimension) { _local3.board[_local2][_local1] = 0; _local1++; } _local2++; } return(_local3); } static function getVerticalPermutation() { var _local1 = getZeroSquare(); _local1.board[0][0] = 1; _local1.board[1][0] = 1; _local1.board[1][2] = 1; _local1.board[2][2] = 1; return(_local1); } static function getHorizontalPermutation() { var _local1 = getZeroSquare(); _local1.board[0][1] = 1; _local1.board[0][2] = 1; _local1.board[2][0] = 1; _local1.board[2][1] = 1; return(_local1); } function transposeVertical(mask) { var _local5 = -1; var _local4 = -1; var _local3 = 0; while (_local3 < dimension) { _local5 = -1; _local4 = -1; var _local2 = 0; while (_local2 < dimension) { if (mask.board[_local3][_local2] > 0) { if (_local4 < 0) { _local5 = board[_local3][_local2]; _local4 = _local2; } else { board[_local3][_local4] = board[_local3][_local2]; board[_local3][_local2] = _local5; } } _local2++; } _local3++; } } function transposeHorizontal(mask) { var _local5 = -1; var _local4 = -1; var _local3 = 0; while (_local3 < dimension) { _local4 = -1; _local5 = -1; var _local2 = 0; while (_local2 < dimension) { if (mask.board[_local2][_local3] > 0) { if (_local4 < 0) { _local5 = board[_local2][_local3]; _local4 = _local2; } else { board[_local4][_local3] = board[_local2][_local3]; board[_local2][_local3] = _local5; _local4 = -1; } } _local2++; } _local3++; } } function clone() { var _local4 = new Square(); var _local3; var _local2; _local3 = 0; while (_local3 < dimension) { _local4.board[_local3] = new Array(dimension); _local2 = 0; while (_local2 < dimension) { _local4.board[_local3][_local2] = board[_local3][_local2]; _local2++; } _local3++; } return(_local4); } function getDimension() { return(dimension); } function getValue(i, j) { var _local2 = 0; if ((((i < dimension) && (i >= 0)) && (j < dimension)) && (j >= 0)) { _local2 = board[i][j]; } return(_local2); } function exchangeRows(origin, target) { var _local3; var _local2 = 0; while (_local2 < dimension) { _local3 = board[target][_local2]; board[target][_local2] = board[origin][_local2]; board[origin][_local2] = _local3; _local2++; } } function exchangeColumns(origin, target) { var _local3; var _local2 = 0; while (_local2 < dimension) { _local3 = board[_local2][target]; board[_local2][target] = board[_local2][origin]; board[_local2][origin] = _local3; _local2++; } } function scrollUp() { var _local2 = 0; while (_local2 < (dimension - 1)) { exchangeRows(_local2, (_local2 + 1) % dimension); _local2++; } } function scrollRight() { exchangeColumns(0, dimension - 1); var _local2 = dimension - 1; while (_local2 > 1) { exchangeColumns(_local2, _local2 - 1); _local2--; } } function scrollLeft() { var _local2 = 0; while (_local2 < (dimension - 1)) { exchangeColumns(_local2, (_local2 + 1) % dimension); _local2++; } } static var dimension = 3; }
Symbol 39 MovieClip [__Packages.Maths] Frame 0
class Maths { function Maths () { } static function randRange(min, max) { var _local1 = Math.floor(Math.random() * ((max - min) + 1)) + min; return(_local1); } static function lucky() { return(randRange(0, 1) == 1); } static function getPermutation(inset, trivialOK) { var _local4 = inset.length; var _local5 = new Array(_local4); var _local7 = new Array(_local4); var _local8 = true; var _local2 = 0; while (_local2 < _local4) { _local5[_local2] = inset[_local2]; _local2++; } _local2 = 0; while (_local2 < _local4) { var _local3 = randRange(0, (_local4 - _local2) - 1); var _local1 = 0; while ((_local1 <= _local4) && (_local3 >= 0)) { if (_local5[_local1] > 0) { _local3--; } _local1++; } if (_local2 != (_local1 - 1)) { _local8 = false; } _local7[_local2] = inset[_local1 - 1]; _local5[_local1 - 1] = -1; _local2++; } if (_local8 && (!trivialOK)) { _local7 = getPermutation(inset, false); } return(_local7); } static function scrollRight(inset) { var _local2 = inset.length; var _local3 = new Array(_local2); var _local1 = 1; while (_local1 < _local2) { _local3[_local1] = inset[_local1 - 1]; _local1++; } _local3[0] = inset[_local2 - 1]; return(_local3); } }
Symbol 32 Button
on (release) { removeMovieClip(boardpanel); removeMovieClip(maskpanel); this.clear(); this.gotoAndStop("1"); }
Symbol 35 Button
on (release) { this.gotoAndStop("2"); }

Library Items

Symbol 1 GraphicUsed by:2
Symbol 2 MovieClip [board]Uses:1
Symbol 3 GraphicUsed by:4
Symbol 4 MovieClip [d0]Uses:3
Symbol 5 FontUsed by:6 8 10 12 15 17 19 21 23 25 26 28 30 31 33 34 36
Symbol 6 TextUses:5Used by:7
Symbol 7 MovieClip [d1]Uses:6
Symbol 8 TextUses:5Used by:9
Symbol 9 MovieClip [d2]Uses:8
Symbol 10 Text [n4]Uses:5Used by:11 14
Symbol 11 MovieClipUses:10
Symbol 12 TextUses:5Used by:13
Symbol 13 MovieClip [d3]Uses:12
Symbol 14 MovieClip [d4]Uses:10
Symbol 15 TextUses:5Used by:16
Symbol 16 MovieClip [d5]Uses:15
Symbol 17 TextUses:5Used by:18
Symbol 18 MovieClip [d6]Uses:17
Symbol 19 TextUses:5Used by:20
Symbol 20 MovieClip [d7]Uses:19
Symbol 21 TextUses:5Used by:22
Symbol 22 MovieClip [d8]Uses:21
Symbol 23 TextUses:5Used by:24
Symbol 24 MovieClip [d9]Uses:23
Symbol 25 TextUses:5Used by:Timeline
Symbol 26 TextUses:5Used by:27
Symbol 27 ButtonUses:26Used by:Timeline
Symbol 28 TextUses:5Used by:29
Symbol 29 ButtonUses:28Used by:Timeline
Symbol 30 TextUses:5Used by:Timeline
Symbol 37 MovieClip [__Packages.SudokuBoard]
Symbol 38 MovieClip [__Packages.Square]
Symbol 39 MovieClip [__Packages.Maths]
Symbol 31 TextUses:5Used by:32
Symbol 32 ButtonUses:31Used by:Timeline
Symbol 33 TextUses:5Used by:Timeline
Symbol 34 TextUses:5Used by:35
Symbol 35 ButtonUses:34Used by:Timeline
Symbol 36 TextUses:5Used by:Timeline

Special Tags

FileAttributes (69)Timeline Frame 1Access local files only, Metadata not present, AS1/AS2.
ExportAssets (56)Timeline Frame 1Symbol 2 as "board"
ExportAssets (56)Timeline Frame 1Symbol 4 as "d0"
ExportAssets (56)Timeline Frame 1Symbol 7 as "d1"
ExportAssets (56)Timeline Frame 1Symbol 9 as "d2"
ExportAssets (56)Timeline Frame 1Symbol 10 as "n4"
ExportAssets (56)Timeline Frame 1Symbol 13 as "d3"
ExportAssets (56)Timeline Frame 1Symbol 14 as "d4"
ExportAssets (56)Timeline Frame 1Symbol 16 as "d5"
ExportAssets (56)Timeline Frame 1Symbol 18 as "d6"
ExportAssets (56)Timeline Frame 1Symbol 20 as "d7"
ExportAssets (56)Timeline Frame 1Symbol 22 as "d8"
ExportAssets (56)Timeline Frame 1Symbol 24 as "d9"
ExportAssets (56)Timeline Frame 1Symbol 37 as "__Packages.SudokuBoard"
ExportAssets (56)Timeline Frame 1Symbol 38 as "__Packages.Square"
ExportAssets (56)Timeline Frame 1Symbol 39 as "__Packages.Maths"




http://swfchan.com/3/12086/info.shtml
Created: 6/6 -2019 11:29:59 Last modified: 6/6 -2019 11:29:59 Server time: 22/12 -2024 17:09:37