Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / NewStats: 3,155,533 members, 7,826,994 topics. Date: Tuesday, 14 May 2024 at 03:04 AM |
Nairaland Forum / Science/Technology / Programming / Help With Sudoku Puzzle Generator (1541 Views)
Sudoku And Linear Algebra / Sorting List Of Numbers And Strings: Simple Puzzle / Sudoku Puzzle (2) (3) (4)
Help With Sudoku Puzzle Generator by kheme(m): 4:01pm On Feb 21, 2009 |
hi. i'm trying to write a sudoku puzzle generator with vb.net but my algorithm seems correct, but runs out of numbers at some stages while generating the puzzle. can anyone look into ma code and see why? Public Class home i've attached screen shots, the "0" in the puzzle are the places where the algorithm runs out of numbers to put cos the next number to put cannot be placed there due to the rules of sudoku. i need help guys!
|
Re: Help With Sudoku Puzzle Generator by Nobody: 7:36am On Feb 23, 2009 |
I wrote one of these in Java over a year ago. You have to use a backtracking algorithm. Set up the rules. Make the algorithm fill in the slots with random numbers line by line. When it gets stuck it should go back a random number of steps(nothing large else you get "array out of bounds"). I will try to find my code, or write it again if I can find the time. |
Re: Help With Sudoku Puzzle Generator by Nobody: 9:26am On Feb 23, 2009 |
Had to write it again. Java code. import java.util.Random; |
Re: Help With Sudoku Puzzle Generator by kheme(m): 7:14pm On Feb 23, 2009 |
ok, i'd see if i can convert the java codes into vb. thanks for the input! |
Re: Help With Sudoku Puzzle Generator by kheme(m): 8:14pm On Apr 05, 2009 |
tried ya code, still didnt work man! |
(1) (Reply)
What Language Does Nairaland Use? Answer Needed. Thanks. / You Can Be A Full Stack Web Developer This Year / Do You Think You Can Develop A Search Engine From Scratch?
(Go Up)
Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health religion celebs tv-movies music-radio literature webmasters programming techmarket Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10) Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 31 |