Git Product home page Git Product logo

hexed_puzzle.rs's Introduction

Hexed Vintage Puzzle Solver

My family has a vintage puzzle from the 70s called "Hexed". It consists of 12 plastic pieces, with the goal of fitting them into a 6×10 unit grid. Each piece is a different shape, which is made up of 5 unit squares in some grid pattern (so I guess the game should be called "Pented" instead, but that's not such a catchy name). Each piece can be rotated by various 90° angles. Many of them can be flipped over to get a mirror-opposite shape.

According to the box, there are over 2,000 solutions.

I have tried solving the puzzle, and found it tauntingly tricky. Some of the pieces are such annoyingly awkward shapes. It's reasonable enough to fit most of them together into the available space. But getting those last 2 or 3 pieces to fit perfectly is a triumph. As far as I can tell, algorithmically, it comes down to a brute-force solution search. But a little logic might speed it up—eg, any "holes" in the solution grid must be a multiple of 5 unit squares, since every piece is made of some arrangement of 5 unit squares.

So I thought I'd try to write a solver. Normally Python is my go-to language for small projects, but for a solver like this, I want speed. I've been learning Rust in the last year or two, so Rust seems to be an excellent choice for a "Hexed" solver.

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.