|
|
Sudoku Solver
Hi all,
I'm trying to create a "Sudoku" solver in Flash. Some of you might not now what Sudoku is. So let me explain:
Sudoku is a puzzle game. The objective is to get all the numbers (1-9) as well as in horizontal, vertical, as in each square right: You have a 9x9 field. In each field there can be a number (1-9). Every horizontal line can have 1 number of each in it. Every vertical line can have 1 number of each in it. AND every square (it's build up of 9 3x3 squares) must have 1 number of each in it. Example of the field:
What's the quickest script or best script to solve these kind of puzzles??? I've thought of a script which will be MILES long: In my script it randomly picks numbers, and then starts correcting itself. First the first line (vertical), then the second line (vertical), etc. Then it's starts correcting itself horizontical and keep the vertical "solving" on. After that it's gonna solve the squares itself, and keeps vertical and horizontal "solving" on. Thinking solving will take lots of time, and sometimes it might get caught in a loop where the numbers keep inflecting thereselves. Now there must be a way easier way to script this (and a better way).
So, can any1 think of something like this?
Grtz, Death
FlashKit > Flash Help > Flash ActionScript
Posted on: 08-13-2005, 04:00 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Sudoku Solver
I suppose this is as good as it's going to get. It can solve all hard Sudokus from web sudoku, but none of the evil ones that I tried.
It's quite OO, as there is one Set class, that Box and Line extend from. Sudoku extends from Box.
The Set holds most methods, such as getRow( int ) and getColumn( int ).
Each object inheriting from Set knows how to solve itself as much as possible. Also, each Set has a one-dimensional array of Cell objects. Each Cell object knows its possibilities, and, once figured out, its value. They hold their possibilities in Cell::value. The Cell::id property is only used for cell identification and testing.
It's important to note that you could instantiate a Line object outside of the context of a Sudoku, and have it solve itself. Same goes for Boxes. When you instantiate any class which inherits from Set, the constructor will want a one-dimensional array of integers, with -1 or null representing an unknown cell.
At any time, you can print any Set class, because they all have __toString() methods which print them as tables. Sudoku overrides Set's method, to allow several Box objects to designate the borders, as would occur in a normal Sudoku puzzle.
Following are the files, in no particular order.
Sudoku Solver's Final Problem
Ok, so i have a sudoku solver i am working on. It takes the user's input and calculates the answer and gives an output. I have 81 textboxed named f1,f2,f3,f4,f5....,f81. i have a datagrid which is:
var Datagrid:Array = [[f1.text,f2.text,f3.text,f4.text,f5.text,f6.text,f7.text,f8.text,f9.text], [f10.text,f11.text,f12.text,f13.text,f14.text,f15.text,f16.text,f17.text,f18.text]... and so on. (every nine textboxes across is one row.)
So i can acsess a certain box using datagrid[j] (Example: Datagrid[0][3] = f4.text) now when the user clicks on the "CHECK" buttoon all boxes without values turn into 0s and then runs the datagrid check.
Example:
0,0,0,9,0,7,3,0,8
0,0,8,0,2,0,0,0,0
3,0,0,0,0,8,0,4,0
2,3,0,0,7,0,0,0,0
0,0,7,1,0,4,9,0,0
0,0,0,0,6,0,0,7,1
0,5,0,7,0,0,0,0,3
0,0,0,0,9,0,7,0,0
6,0,9,8,0,5,0,0,0
OK now here is the trickey part, i want the program to start at
Datagrid[0][0] and check if a value: "n", is in row one (Datagrid[0][1-9])
and colum 1 (Datagrid[1-9][0])
so i have tried using various loops, and if statements to checks this, such as:
if(n == Datagrid[j]){
n++;
}else{
j++;
.....etc.....
Now i really need help on this! to do a check to see if it is in the row and colum that the text box is in. (Example: box 1 checks row1,col1. box2 checks row1,col2)
-------------------------------------------------------------------------
Now this part may or may not be of any use to any of you but, if 'n' is in either row1 or col1 or both of them n++, if its not it either of them 'n' is placed in that box and it moves on to check the next box.
-------------------------------------------------------------------------
i think i have given all the possable information i can regarding this, however if any one needs any clearing up PLEASE!! e-mail me at
joshtremblay91@hotmail.com
Please help me, any help is greatly apriciated!!
Problem Solver...
I've come across a bit of a brick wall, I want my movie which includes 3 movies all pretty close to each other (see fla) what I want is if the user presses one button (while another movie is open) the movie that is open to play the "out" animation and when that ends the movie selected to open and animate "in".
Know what I mean? Any help would be much appreciated!
Top Dollar To The Problem Solver
I need to borrow someones brain power!! Can anyone modify FLASH MX's dynamically imported jpg viewer, so that you can set the scale of the jpg being imported? Ex( importing the image at 50% of it's original size.
If you can figure that out, I would also like to have a button that could be used to blow up the image once it's loaded into the target
Problem Solver Needed
Hi,
I am creating a music player and need help getting some of the code working.
I have my main flash movie which has two movie clips in it. Movie Clip 1 is a blank movie clip which i load an external swf in to (containing a song). Movie Clip 2 is the menu.
What I need is when MC1 gets to the end of the song, I need it to tell the Menu to go back to it's "no music playing" label.
This is the code in the external swf:
gotoAndStop(1);
_root.menu_mov.gotoAndStop(1)
...This doesn't work, any ideas why?
("_root.gotoAndStop(1)" does work)
Thanks, Ed
AS3- Recursive Maze Solver
hey,
I just switched over to actionscript 3 from 2 and to help me get used to it, I created a simple program that visually shows how a maze is solved recursively using the backtracking method. The maze is actually solved first, the steps stored in an array and then shown afterwards.
http://img225.imageshack.us/my.php?i...esolverbc3.swf
Sorry I dont have a webhost, but you can download the .as file from here:
http://www.sharebigfile.com/file/275...Solver.as.html
Some of the private functions in my code are there to help me debug.
Sudoku Help
I was wondering if anyone knew how to make sudoku in flash. I don't know how you generate the puzzles, and I don't want to enter them one at a time.
Sudoku
hii,
am making a 9x9 sudoku in as2, where i ve made the question set without any problem. now the only and biggest problem is of comparision.
Am using a single array for txt boxex, where txt boxes are named as t1, t2, .... t81.
please tell me the solution and suggestions that i can make use of .
thnx in advance.
Sudoku
I am new to flash and i want to create a sudoku game. So far i have created 81 textboxes named f1,f2,f3,f4...f81.
Also i created18 arrays called rowone, rowtwo, rowthree...rownine. and then colone, coltwo, colthree...colnine.
now how would i go about checking the first box (f1) to see what values can fit in that box considering the numbers in rowone, and colone. than i want it to insert the lowest possable number and continue on to the second box (f2).
after checking itself it will have to go back and refill in the first text box with the second lowest possability if there is that number in a row or colum stoppping it. eventually it will solve itself all out.
ANY help is greatly appreciated.
To Create A Sudoku
Hi all,
I want to create a sudoku in flash. ( Wikipedia explanation ).
I DONOT want to solve it. I have to check if the user has put the correct numbers in the boxes.
I have tried using a two dimensional array and storing the numbers in them. but for each of the nines boxes, i have to type separate function. I tried using a 'for' loop and replacing the instance name of the mc with the 'i' value. But my flash gives errors.
Or my approach is wrong. pls help.
*HELP With Sudoku Grid
i am trying to produce a sudoku game in flash. so far i have produced the grids and have named them, and populated them with random number, however they are not yet validated to the rules of sudoku, and that is my problem.
Im trying to find a way to get each rows, and each columns into separate arrays, where i would be able to compare them and see each repeating numbers, however i have been trying to find a solution to this for the past week and have not been able to do anything.
Here is the code:
first function creates the grid, and the second one fills it in.
I have also inserted the fla as an attachment!
Can anyone please help me with this, or if they know of a better solution, can you guide me in the right direction.
Thank you for your help!
function CreateGrid() {
startX = 0;
startY = 0;
initX = 0;
initY = 0;
counter = 0;
counter2 = 0;
for (var gridRows = 1; gridRows<=3; gridRows++) {
for (var gridCols = 1; gridCols<=3; gridCols++) {
for (var i = 1; i<=3; i++) {
for (var j = 1; j<=3; j++) {
counter++;
cName = "cell"+counter+"R"+i+"C"+j;
grid_container.attachMovie("cellMC", cName, counter);
//grid_container["cell"+counter].randomNumber.text = this._name;
grid_container[cName]._x = startX+initX;
grid_container[cName]._y = startY+initY;
grid_container[cName].onRelease = function() {
cellTxt.text = this._name;
};
initX += 25;
}
//j(cols) FOR LOOP
initY += 20;
//create new row
initX = 0;
//create new row in same xpos
}
//i(rows) FOR LOOP
startX += 80;
//create new grid
initY = 0;
//create new grid in same ypos
}
//gridCols FOR LOOP
startY += 65;
startX = 0;
}
//gridRows FOR LOOP
}
function RandNumber() {
aNumber = random(9);
if (aNumber == 0) {
aNumber = random(9);
}
return aNumber;
}
function FillGrid() {
counter = 0;
counter2 = 0;
for (var gridRows = 1; gridRows<=3; gridRows++) {
for (var gridCols = 1; gridCols<=3; gridCols++) {
RandNumber();
for (var i = 1; i<=3; i++) {
for (var j = 1; j<=3; j++) {
counter++;
cName = "cell"+counter+"R"+i+"C"+j;
grid_container[cName].randomNumber.text = aNumber++;
if (aNumber>9) {
aNumber = 1;
}
}
}
}
}
}
Sudoku Grid
I am attempting to make a class file that will create a Sudoku grid. I started a while back and stoped. I'm back on it again, and have done a lot of research, broke open other apps that say completly random grids..endless number. They all use a data sources and load the grids from there. I've had gotten far on mine, but every grid had empty spaces where no number will work for the game. Thats when I stoped. I was wondering if anyone knows if creating a sudoku grid on the fly is even possible, and if so..help in anyway you can. I want to have a solution before the release of Vista, so I can translate it into javascript and let people use it for gadgets.
Sudoku Game Help
Hi all,
For those who don't know the puzzle/game: www.sudoku.com
I've got the grid & the check working. I'm not trying to create a generator. Just a fixed setup and 1 solution. Just a fun game we repeat a few times a year in our company as a fun contest. But i still have some small problems to fix. Hope some AS master can help me out. This is the code:
Code:
var tFormat:TextFormat = new TextFormat();
tFormat.font = "Verdana";
tFormat.color = 0x666666;
tFormat.align = "center";
tFormat.size = 12;
//Horizontal distance betweer textfields
var hor:Number = 40;
//Vertical distance betweer textfields
var ver:Number = 40;
//Start X of 1st field
var startX:Number = 10;
//Start Y of 1st field
var startY:Number = 16;
//
var counter:Number = 0;
//Create first Sudoku Setup
var aSetup = [
[ "", 6 , "", 1 , "", 4 , "", 5 , ""],
[ "", "", 8 , 3 , "", 5 , 6 , "", ""],
[ 2 , "", "", "", "", "", "", "", 1 ],
[ 8 , "", "", 4 , "", 7 , "", "", 6 ],
[ "", "", 6 , "", "", "", 3 , "", ""],
[ 7 , "", "", 9 , "", 1 , "", "", 4 ],
[ 5 , "", "", "", "", "", "", "", 2 ],
[ "", "", 7 , 2 , "", 6 , 9 , "", ""],
[ "", 4 , "", 5 , "", 8 , "", 7 , ""]
];
//Build up grid
for (var i = 0; i<9; i++) {
for (var j = 0; j<9; j++) {
counter++;
// We generate textfields
var tF:TextField = mcContainer.createTextField("tField"+counter, counter, startX+(j*hor), startY+(i*ver), 30, 20);
tF.setNewTextFormat(tFormat);
tF.type = "input";
tF.maxChars = 1;
tF.restrict = "1-9";
tF.align = "right";
tF.text = aSetup[i][j];
if (mcContainer["tField"+i].text != "") {
mcContainer["tField"+i].selectable = false;
}
}
}
// Error listing
error0 = "There is still an error in your Sudoku, hurry up, solve it and win that cake!";
error1 = "They told me you were the smartest around here and still there is at least one error";
error2 = "You did read the rules right? Come on, you can do it!";
//Random error msg
errorMsg = "error"+random(3);
//String with all the right numbers in a row to check if the input from the user is right
var sSolution:String = ",9,6,3,1,7,4,2,5,8,1,7,8,3,2,5,6,4,9,2,5,4,6,8,9,7,3,1,8,2,1,4,3,7,5,9,6,4,9,6,8,5,2,3,1,7,7,3,5,9,6,1,8,2,4,5,8,9,7,1,3,4,6,2,3,1,7,2,4,6,9,8,5,6,4,2,5,9,8,1,7,3";
//Split up the string where "," is used
var aCheck:Array = sSolution.split(",");
trace(aCheck.length);
//Submit bt - to check if input is right
mcSubmit.onRelease = function(){
//For loop , looping as long as the length of the solution string of numbers
for (i = 1; i<aCheck.length; i++){
trace("Current no = " + i);
trace("Field = " + mcContainer["tField"+i].text);
trace("Check = " + aCheck[i]);
//If looped 82 times the input didn't contain any errors - puzzle solved! :)
if (i == 82){
trace("Done!");
break;
}
//Check every field if input is right, if not, stop the for loop and give error msg
if (mcContainer["tField"+i].text != aCheck[i]){
trace("error");
error = errorMsg;
break;
}
}
}
Problem 1: What i want to do is to make the given numbers on the grid (see aSetup) to be marked (like bold or something) and non-selectable. See the bold code to see what i'm trying
Problem 2: I want to have a random error message. It does work but shows the error var name in the txtfield. Not the value of the var. See bold code. Also it doesn't update/refresh when i click the submit button again. I know it's a small bug, but just can't find the solution atm, i've been working on it all day, became a little blurry
Option: How hard is it to show on what row the error is? X or Y axis? It's not a must have, but it would be a nice and usefull feature.
Thanks in advance!
Cheers,
Xs
Sudoku Problems Again
Here is what i get for Output when i run this code:
" ReferenceError: Error #1069: Property 1 not found on Number and there is no default value.
at sudokuframe_fla::MainTimeline/reportClick() "
Code: -------------------------------------------------------------------------------------------------------------------------------------------------------------
Attach Code
checkbtn.addEventListener(MouseEvent.CLICK, reportClick);
function reportClick(event:MouseEvent):void{
//Here is the rows of your data grid where you save your input textboxes.
var row1:Array = [0,0,0,9,0,7,3,0,8];
var row2:Array = [0,0,8,0,2,0,0,0,0];
var row3:Array = [3,0,0,0,0,8,0,4,0];
var row4:Array = [2,3,0,0,7,0,0,0,0];
var row5:Array = [0,0,7,1,0,4,9,0,0];
var row6:Array = [0,0,0,0,6,0,0,7,1];
var row7:Array = [0,5,0,7,0,0,0,0,3];
var row8:Array = [0,0,0,0,9,0,7,0,0];
var row9:Array = [6,0,9,8,0,5,0,0,0];
var i:Number = 0;
var j:Number = 0;
//This is the double array, so you can use trace(Datagrid[i][j]); to access it.
var Datagrid:Array = [row1, row2, row3, row4, row5, row6, row7, row8, row9];
trace ("Row 1: " + row1[0][1][2][3][4][5][6][7][8][9]);
trace("Datagrid :" + Datagrid);
trace("Content of Datagrid [0] : " + Datagrid[0]);
trace("Content of Datagrid [i][j] :" +Datagrid[0][1]);
//From here, you can do a recursive function to check each coordinate
//using an if function or a for loop.
}
Sudoku Game - Need Some Help
Hi all,
For those who don't know the puzzle/game: www.sudoku.com
I've got the grid & the check working. I'm not trying to create a generator. Just a fixed setup and 1 solution. Just a fun game we repeat a few times a year in our company as a fun contest. But i still have some small problems to fix. Hope some AS master can help me out. This is the code:
Code:
var tFormat:TextFormat = new TextFormat();
tFormat.font = "Verdana";
tFormat.color = 0x666666;
tFormat.align = "center";
tFormat.size = 12;
//Horizontal distance betweer textfields
var hor:Number = 40;
//Vertical distance betweer textfields
var ver:Number = 40;
//Start X of 1st field
var startX:Number = 10;
//Start Y of 1st field
var startY:Number = 16;
//
var counter:Number = 0;
//Create first Sudoku Setup
var aSetup = [
[ "", 6 , "", 1 , "", 4 , "", 5 , ""],
[ "", "", 8 , 3 , "", 5 , 6 , "", ""],
[ 2 , "", "", "", "", "", "", "", 1 ],
[ 8 , "", "", 4 , "", 7 , "", "", 6 ],
[ "", "", 6 , "", "", "", 3 , "", ""],
[ 7 , "", "", 9 , "", 1 , "", "", 4 ],
[ 5 , "", "", "", "", "", "", "", 2 ],
[ "", "", 7 , 2 , "", 6 , 9 , "", ""],
[ "", 4 , "", 5 , "", 8 , "", 7 , ""]
];
//Build up grid
for (var i = 0; i<9; i++) {
for (var j = 0; j<9; j++) {
counter++;
// We generate textfields
var tF:TextField = mcContainer.createTextField("tField"+counter, counter, startX+(j*hor), startY+(i*ver), 30, 20);
tF.setNewTextFormat(tFormat);
tF.type = "input";
tF.maxChars = 1;
tF.restrict = "1-9";
tF.align = "right";
tF.text = aSetup[j];
if (mcContainer["tField"+i].text != "") {
mcContainer["tField"+i].selectable = false;
}
}
}
// Error listing
error0 = "There is still an error in your Sudoku, hurry up, solve it and win that cake!";
error1 = "They told me you were the smartest around here and still there is at least one error";
error2 = "You did read the rules right? Come on, you can do it!";
//Random error msg
errorMsg = "error"+random(3);
//String with all the right numbers in a row to check if the input from the user is right
var sSolution:String = ",9,6,3,1,7,4,2,5,8,1,7,8,3,2,5,6,4,9,2,5,4,6,8,9,7,3,1,8,2,1,4,3,7,5,9,6,4,9,6,8,5,2,3,1,7,7,3,5,9,6,1,8,2,4,5,8,9,7,1,3,4,6,2,3,1,7,2,4,6,9,8,5,6,4,2,5,9,8,1,7,3";
//Split up the string where "," is used
var aCheck:Array = sSolution.split(",");
trace(aCheck.length);
//Submit bt - to check if input is right
mcSubmit.onRelease = function(){
//For loop , looping as long as the length of the solution string of numbers
for (i = 1; i<aCheck.length; i++){
trace("Current no = " + i);
trace("Field = " + mcContainer["tField"+i].text);
[i] trace("Check = " + aCheck);
//If looped 82 times the input didn't contain any errors - puzzle solved! :)
if (i == 82){
trace("Done!");
break;
}
//Check every field if input is right, if not, stop the for loop and give error msg
[i] if (mcContainer["tField"+i].text != aCheck){
trace("error");
[i] error = errorMsg;
break;
}
}
}
Problem 1: What i want to do is to make the given numbers on the grid (see aSetup) to be marked (like bold or something) and non-selectable. See the bold code to see what i'm trying
Problem 2: I want to have a random error message. It does work but shows the error var name in the txtfield. Not the value of the var. See bold code. Also it doesn't update/refresh when i click the submit button again. I know it's a small bug, but just can't find the solution atm, i've been working on it all day, became a little blurry
Optional: How hard is it to show on what row the error is? X or Y axis? It's not a must have, but it would be a nice and usefull feature.
Thanks in advance!
Cheers,
Xs
Sudoku In Flash
hi all,
Have any one tried sudoku generator or solver completely in flash..
Sudoku - If I Build It Will They Come
The Sudoku game generator web service I've been working on is ready. Easy is easy, and hard is HARD.
So why'd I build the damn thing, other than the fact I really wanted to build a Sudoku client that had all the features I want, and offered consistently and measurably challenging puzzles...and that I hadn't done any real game programming in a while...actually it doesn't seem like I really need another reason, but I do have one anway.
I'm thinking of starting a Sudoku UI challenge to demo:
- SOA-style Flash game community development. You don't worry about the puzzle generation logic. Ask for a puzzle at difficulty 1-4, get back a score that determines the difficulty, the starting numbers and positions, and the solved puzzle. You could use Flex too if you wanted, though I think we'd need to keep the product categories seperate as well as compare them as a whole (i.e. I wouldn't expect an Ajax client to have half the whizbang of a full on Flash client).
- Determination of a "best" lowest common denominator for Sudoku UI features. Let's face it, most of the Sudoku clients I see have some really annoying things (like, selecting a wrong answer erases your pencil marks permanently), and the majority of the ones on the web are just broken and/or are easily breakable.
- Innovations around Sudoku gaming. Not changing the game, but adding scoring and/or board features to make the game more challenging. For instance, I have an "Options" list in my client, which can do interesting things to the board. Doesn't change the game, but can throw off your orientation, and adds additonal stats to measure (a score is made up of time to complete, shortest time to move, longest time to move, difficulty, options selected, right vs. wrong guesses, etc). Multiplayer is also something I'm looking over; it exists, but maybe something more than round robin "pass" Sudoku.
- Coding counts! It can't just work, it must work well.
Keeping in mind that the best Sudoku client I've seen (PSP GoSuduko) actually has a couple of annoying things about it (that damn "Please Wait" screen that takes 10 seconds of ticking game time to clear, and the cleared pencil mark thing, etc.), I'm pretty sure that the top ranks of this challenge could use the product as a solid portfolio item. I of course would recuse myself, but would still post a client.
If enough are interested, I'll put the web service up publicly on an announced date, post the client-side webservice code so you don't have to figure out how to make the call, and off we go.
Sudoku Programming Anybody?
After researching what's out there regarding programming a Sudoku generator and client, I've been assembling what appears to be the best practices into two different libraries; a .Net C# one, and an ActionScript 2.0 one.
The idea is, the C# one will back a web service that generates a puzzle grid based on a desired difficulty level; the client requests the puzzle, receives the data, and it's up to the client to work with the retrieved data (essentially just a 9x9 grid of numbers...writing basic Sudoku clients actually isn't hard at all, relatively). The AS one is intended for a standalone swf (whether web page delivered or not).
I'm having reasonable success in both areas, and was just curious if anybody else had any experience with this interesting area of game programming. I've read through some books and so on, and as expected, have found different thoughts and approaches (i.e., the debate regarding, "there should only be one unique solution to any generated puzzle" vs. "it is acceptable, and in fact part of the original design, to allow brute force/multiple solutions for high difficulty puzzles". The way you lean on this makes a significant difference in your generation algs).
Also for the moderators, maybe we could use a "Games Programming" forum...I don't really see exactly where to post this subject, or further data regarding my socket server for multiuser stuffs.
Sudoku Game
I have to make a sudoku game and I don't know where to start...
Dose anyone have any idea if this will be a hard project or an easy one?
Tips For Sudoku Flash
Hi everyone.
I have to make a Sudoku game in Flash, with action script, but I'm struggling a lot. With what we have been taught so far I just can't see a way to make one and its impossible to find any tutorials or open code to study on the net.
My main problem is that I don't know how I can organise it so that numbers can only be placed within a grid and how to then check said grid. Is there some kind of grid tool or what?
Any help, tips are greatly appreciated, as is your time for reading this post.
Thanks.
Creating A Flash Sudoku
Hey all,
I'm a graduate Animation student who's trying to create a Sudoku game primarily using Flash. I have little experience with Flash ActionScript programming, though I have made a game or two in school. I'm trying to find out what sort of code would be needed to create random, valid Sudoku puzzles in Flash using buttons or movieclips as the integers. I'd gladly accept any and all help, as I'm really just trying to get started. I have my own graphics to use and style in mind, but basically I want to have randomly generated puzzles at 3 difficulties, Easy Medium and Hard. The only difference for each difficulty, I think, will be the number of givens.
If anyone at all can help me out here, I'd definitely appreciate it. Thanks!
Sudoku Rule Function
This is my solution 2D array, I have another array for board pre game, which is updated by the user at runtime using input text boxes e.g (9, 1,input1.text,input2.text...)
9, 1, 3, 4, 7, 5, 6, 8, 2
6, 5, 4, 2, 8, 3, 9, 7, 1
7, 8, 2, 9, 6, 1, 3, 4, 5
2, 6, 7, 5, 3, 4, 8, 1, 9
8, 4, 9, 6, 1, 2, 5, 3, 7
1, 3, 5, 8, 9, 7, 4, 2, 6
5, 2, 1, 3, 4, 9, 7, 6, 8
4, 7, 8, 1, 5, 6, 2, 9, 3
3, 9, 6, 7, 2, 8, 1, 5, 4
This function takes a column from the user entered 2d array and puts it in a new array ready for comparison.
function checkColumn(col){
c_array = new Array();
for (i=0;i<9;i++){
c_array[i]= user_Array[i][col];
}
return c_array;
}
I want to use TextField.onChanged to trigger a function that compares the user inputed value with the values already in the user entered array. So if there was already a 9 the output would be "illegal move" or something. Im sorry I can't explain this very clearly.
Sudoku Game, Almost There, But Ive Fallen Short.. Help?
Hello!
My friend thought he was a genius by making some crappy Sudoku game on a games factory that did all the work for him, now... I am almost there with this but have run into a hiccup.
All I need to do, is call a function on a 1 of the 9 mc's (called grid"1-9") that is in the mc Im working with.
For instance.
grids:
var completeGrid:Number = 1;
var t:MovieClip = this["grid" + completeGrid];
t.startGrid();
Ok, then that function will run on the mc named "grid1"
and do all the code for that mc, and at the end will do...
grid:
function startGrid() {
//BLAH BLAH BLAH
//CODE CODE CODE
_parent.completeGrid++
var nextGrid:MovieClip = _parent["grid" + _parent.completeGrid];
nextGrid.startGrid;
}
and will continue doing that until completeGrid gets to 10. And then move to the next frame, or whatever.
But my problem lies with calling functions on a different movieClip, I cant get the "t.startGrid();" to work at the moment.
URGENT I Need To Create A Sudoku Game
I need to create a Sudoku Game within 3days.. i have the grid and the number..i want to create one that can check the diaganal and horizontal and see if same number is used...if same number is used, the number cant be placed.Can anyone help me? I need one that can let me insert my own number
thankz
|
|
|