https://github.com/tyfkda/jellysolver
https://github.com/tyfkda/jellysolver
Last synced: over 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/tyfkda/jellysolver
- Owner: tyfkda
- Created: 2025-01-12T02:40:55.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-01-22T02:18:58.000Z (over 1 year ago)
- Last Synced: 2025-01-22T03:22:54.907Z (over 1 year ago)
- Language: Ruby
- Size: 2.85 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
ゼリーのパズルソルバー
======================
[ゼリーのパズル](http://qrostar.skr.jp/index.cgi?page=jelly)ソルバー

#### Ruby
```
$ cd ruby
$ ruby main.rb ../stagedata/001.txt
Solved!
##############
#............#
#............#
#............#
#............#
#........R...#
#BB....G##...#
##...B.R.....#
##.#.#####G###
##############
[1, 6, 1]
##############
#............#
#............#
#............#
#............#
#........R...#
#......G##...#
##BB.B.R.....#
##.#.#####G###
##############
[2, 7, 1]
##############
#............#
#............#
#............#
#............#
#........R...#
#......G##...#
##.BBB.R.....#
##.#.#####G###
##############
[7, 7, 1]
##############
#............#
#............#
#............#
#............#
#........R...#
#.......##...#
##.BBB.GR....#
##.#.#####G###
##############
[7, 7, 1]
##############
#............#
#............#
#............#
#............#
#........R...#
#.......##...#
##.BBB..GR...#
##.#.#####G###
##############
[9, 5, 1]
##############
#............#
#............#
#............#
#............#
#............#
#.......##...#
##.BBB..GRR..#
##.#.#####G###
##############
[8, 7, 1]
##############
#............#
#............#
#............#
#............#
#............#
#.......##...#
##.BBB...GRR.#
##.#.#####G###
##############
[9, 7, 1]
##############
#............#
#............#
#............#
#............#
#............#
#.......##...#
##.BBB....GRR#
##.#.#####G###
##############
Steps=7, check=43, elapsed=0.009s
```
## リンク
* 解説ブログ記事:[「ゼリーのパズル」ソルバーを作る(A*)](https://tyfkda.github.io/blog/2025/01/13/jelly-solver.html)
* [Rubyで優先度付きキューを実装した](https://gengogo5.com/posts/33) ACした優先度付きキュー`PriorityQueue`を使わせていただきました