Giter VIP home page Giter VIP logo

sudoku-engine's Introduction

Sudoku Engine

Algorithm to solve & generate sudoku puzzles, with equivalent implementations in Crystal, C++, and TypeScript.
(or at least as similar as I could make them)

See the readme in each implementation's directory for build & run instructions:

Background

I started this in early 2019 as a pet project for me to learn the Crystal Language.

Soon after getting an initial version working in Crystal, I wanted to test Crystal's claim: "As fast as C; as slick as Ruby", so I began implementing the same algorithm in C++ to test the performance of the equivalent engines built in C++ vs in Crystal. So far, the one I built in C++ is actually slower. . . Go Crystal!

I also wanted to spread the word about Crystal since I enjoyed working with the language so much, so I also wrote an equivalent implementation in TypeScript so that anyone who feels most comfortable in the world of JavaScript would be able to use this a fun way to get introduced to Crystal. I chose TypeScript over JavaScript for the sake of similarity to Crystal, since Crystal is a statically typed language and its type annotations are often similar to those of TypeScript.

My C++ was pretty rusty when I got started with this and there are likely some best practices for good performance which I'm missing in the present C++ implementation, so maybe it would be able to match the timing of the Crystal implementation given all best practices. But even if that's the case, it renewed my appreciation for the considerations that we do not have to worry about when writing in a language like Crystal rather than C/C++ (e.g. memory leaks). My guess is that even the most experienced C++ developer could not make an implementation which is significantly more performant than the equivalent implementation in Crystal.

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.