8-sliding-puzzle 中文文档教程

发布于 3年前 浏览 26 项目主页 更新于 3年前

8-sliding-puzzle

一个简单的 8 块方块拼图。 你能在 50 步以内组装吗?

install

$ npm install -g 8-sliding-puzzle

rule

  • This puzzle is a sliding puzzle having 8 square tiles numbered 1–8 in a frame that is 3 tiles high and 3 tiles wide, leaving one unoccupied tile position.
  • Tiles in the same row or column of the open position can be moved by sliding them horizontally or vertically, respectively.
  • You can move it 50 times in one puzzle.
  • The goal of the puzzle is to place the tiles in numerical order.
  • And at the end, be sure to put the blank tile in the lower right corner.

usage

$ 8-sliding-puzzle

选择一个号码并按回车键。

Let's complete this puzzle within 50 moves.

  ---+---+---
   3   1   2
  ---+---+---
   7   4   5
  ---+---+---
   8   6
  ---+---+---


? [Select a number you want to move:] 1/50 …
❯ 5
  6

已解决的 8 滑动拼图

  ---+---+---
   1   2   3
  ---+---+---
   4   5   6
  ---+---+---
   7   8
  ---+---+---

LICENSE

麻省理工学院

8-sliding-puzzle

A simple puzzle of 8 square tiles. Can you assemble within 50 moves?

install

$ npm install -g 8-sliding-puzzle

rule

  • This puzzle is a sliding puzzle having 8 square tiles numbered 1–8 in a frame that is 3 tiles high and 3 tiles wide, leaving one unoccupied tile position.
  • Tiles in the same row or column of the open position can be moved by sliding them horizontally or vertically, respectively.
  • You can move it 50 times in one puzzle.
  • The goal of the puzzle is to place the tiles in numerical order.
  • And at the end, be sure to put the blank tile in the lower right corner.

usage

$ 8-sliding-puzzle

Select a number and press enter.

Let's complete this puzzle within 50 moves.

  ---+---+---
   3   1   2
  ---+---+---
   7   4   5
  ---+---+---
   8   6
  ---+---+---


? [Select a number you want to move:] 1/50 …
❯ 5
  6

A solved 8-sliding-puzzle

  ---+---+---
   1   2   3
  ---+---+---
   4   5   6
  ---+---+---
   7   8
  ---+---+---

LICENSE

MIT

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文