GithubHelp home page GithubHelp logo

sudoku-generator-cs's Introduction

Sudoku Board Generator

Sudoku board generator for C#

Usage

Compile the application, and use like so:

generator <workers> <puzzles> <output>

Where:

  • workers is the number of threads to use for processing.
  • puzzles is the number of puzzles you would like to generate.
  • output is the directory in which to write the puzzles.

Another generator? Really?

This board generator was used in my Aivoterveydeksi! application build for iOS. I used this utility to generate thousands of boards to bundle with the app. You can read about why here.

Plans

This project may be revisited later for an overhaul, as it was never intended to be made public. I do have plans to release a NodeJS version as well, so that may take priority.

sudoku-generator-cs's People

Contributors

perry-mitchell avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

sudoku-generator-cs's Issues

Thread termination message order has unexpected behavior

I've added thread numbers to the output of the foreach-loop in the main thread:

foreach (Thread t in threads)
{
	t.Join();
	Console.WriteLine($"Thread #{threads.IndexOf(t)} terminated.");
}

This shows the following result:

image

The reason behind this is that t.join() does join the first thread from that list and stay there.

A possible workaround would be having the worker itself report its termination, and keep this list without output.

numPuzzles does not take into account numWorkers

The workers use messenger.getMaxPuzzles() to check the number of remaining puzzles to generate.

This does not take into account the number of workers. For example using 16 threads for 32 puzzles makes you end up with 47 puzzles in total.

A workaround is lowering the numPuzzles with the number of threads.

Missing project file

Hi!

Thanks a lot of sharing this code under the MIT license; I might use it for a project of mine!
I hope you don't mind me opening a few issues that I've encountered - that might help you or others on improving/using this code.

The first thing I noticed was a missing project file. I've loaded the code into an empty .NET Core 3.1 project and everything does run out of the box.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.