GithubHelp home page GithubHelp logo

fogleman / rush Goto Github PK

View Code? Open in Web Editor NEW
282.0 8.0 26.0 149 KB

Rush Hour puzzle goodies!

Home Page: https://www.michaelfogleman.com/rush/

License: MIT License

Go 57.32% Makefile 4.30% C++ 24.93% JavaScript 10.88% HTML 0.87% CSS 0.55% Python 1.15%
go rush-hour unblock-me puzzle game

rush's Introduction

Rush Hour (the puzzle)

This repo contains a bunch of stuff related to Rush Hour, a sliding block puzzle. You may also know this game from one of its iOS implementations, such as Unblock Me.

Read the Article

https://www.michaelfogleman.com/rush/

Play Online

https://www.michaelfogleman.com/static/rush/

Overview

The Go code can solve puzzles, render puzzles to PNG, generate puzzles, and more.

The C++ code "solves" the entire game - identifying all "interesting" puzzles that are possible. Read the article for more information. A database of puzzles is available.

The JavaScript code is for the online player.

51

rush's People

Contributors

fogleman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rush's Issues

For 60 step one, the resolution is obviously wrong

go run cmd/solve/main.go IBBxooIooLDDJAALooJoKEEMFFKooMGGHHHM
{true [L-1 G+1 J+1 D-2 K+1 C-3 K-1 L-2 D+3 K+2 A+2 C+2 J-2 E+1 I+1 H+1 B-1 J-2 A-2 K-1 E+3 K+1 A+2 J+4 B+1 C-2 H-1 A-3 K-2 D-3 E-1 K+1 L+2 C+3 K-1 D+2 J-3 F+1 I+1 D-3 J+2 K+1 C-1 L-1 E+1 K+1 A+3 H+1 B-1 J-3 A-2 D+1 I-1 F-1 G-1 K-1 E-3 K+1 L+2 A+3] 60 103 60 2060 246774}

guess there is a offset one problem.

How to render letters on pieces?

I edited /render.go setting showPieceLabels = true at line 14 then I launched go run cmd/render/main.go BCCPooBDDPooAAEPooooEFFQGGHoIQJJHoIQ out.png and tried other changes but it seems it doesn't apply my edits: I can't see letters.

Note: I don't know Go/Dart/C++/Python/Java, but I'm a developer and I know JavaScript and Node.

Thanks

New logo/icon

Hi, I am a graphic designer, I want to help others in graphic design.

After I reviewed your project, you have no logo on this project. Therefore I want to contribute to this project by creating a new logo / icon. what do you think?

Solver renames puzzle pieces

This isn't an issue that I expect the author to fix, more just information for other Rush Hour'ers.

If you run the go code to solve a board, the solver renames the pieces. They are no longer left-right/top-bottom after the solver does its thing. However, if you go here:

https://go.dev/play/

And paste in this code:

package main
import (
	"fmt"
	"log"
	"github.com/fogleman/rush"
)
func main() {
	board, err := rush.NewBoardFromString("IBBxooIooLDDJAALooJoKEEMFFKooMGGHHHM")
	if err != nil {
		log.Fatal(err)
	}
	solution := board.Solve()
	fmt.Println(solution)
	fmt.Println(board)
}

Replacing that board layout with whatever puzzle layout you want the solution for, it will print out not only the solution but the revised puzzle map. Maybe someone will find this helpful.

Close me as not a bug, just a known quirk.

BoardSize in config.h

Hi, in cpp solver code base, BoardSize in config.h is set to 5, however I think it should be set to 6.

Number of MaxID

In this directory; cpp/src/config.h
Anyone know how can he find these numbers?
And if I want to execute a board with size 7x7, which number would be?

const uint64_t MaxID = 268108; // 5x5
const uint64_t MaxID = 243502785; // 6x6

Can't seem to generate puzzles with walls

I have run cmd/generator/main.go. But they keep generating 6x6 puzzles with no walls. Edited the generator.go:22 line to NewRandomBoard instead of NewEmptyBoard. But they keep returning from model.go:665 mutateAddWall function. I can see walls being generated in your online web game. What am I doing wrong?

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.