Git Product home page Git Product logo

rusty_queens's Introduction

Rusty Queens

semver GitHub issues by-label

A simple project while learning Rust - a solution to the n-queens problem.

Getting Started

This project exists to help me get started with Rust. It's not meant to be a good illustration of the n-queens problem per se, so please move along if you're looking for a serious implementation of the algorithm.

Prerequisites

Building

If you've got Rust installed and the repo cloned, all you need to do is build and run. Here's how:

cd <path-to-repo>
cargo build             # Build the project
cargo run --release     # Run it

If it worked, you'll also find a binary in the target/release directory that you can run directly. Good luck!

Contributing

Feeling unsure of yourself in Rust ... or just plain bored? Then this is the project for you! Feel free to contribute by submitting pull requests that compile. I'll be sure to take a look at it ... eventually.

Rusty Queens License

This project is licensed under the MIT License - see the LICENSE file for details.

rusty_queens's People

Contributors

mattgianni avatar

Stargazers

 avatar

Watchers

 avatar

rusty_queens's Issues

Testing would be nice!

If we don't come up with some unit tests our readme will be wrong. It claims we got some.

Better algorithm

It seems like the current impl kinda sucks. As it is placing queens on the board column by column, it has to check all the previous columns to see if there is a collision.

It seems better to create four arrays to represent columns, rows and the two diagonals, and then mark them as 'used' once they are occupied by a queen so that you do not need to check all the previous ones every time. Just look for an open space and stick a queen there, and then update the four arrays ...

Give it a try and see if it works.

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.