一种用于解决数独难题的cli工具。

sudoku-cli的Python项目详细描述


一种用于解决数独难题的cli工具。

安装

pip install sudoku-cli

命令

sudoku命令的帮助页是一个很好的概述:

Usage: sudoku [OPTIONS] INPUT_FILE

  A command line tool for taking an input file encoding sudoku problems and
  writing their solutions to stdout.

  The input file consists of one sudoku problem per line, where each line is
  a string of integers in the range 0-9. A 0 denotes an empty location while
  all the other digits are filled cells. This string represents a walk
  through the grid from top to bottom and left to right.

  By default it exits with a message after encountering either an invalid
  problem or an unsolvable problem.

Options:
  -s, --size INTEGER  Size of the encoded sudoku problems. Defaults to 9.
  -i, --ignore        Silently ignores all errors. Writes blank lines for
                      unworkable problems.
  --help              Show this message and exit.

输入文件

输入文件格式在上面的帮助页中进行了描述。

所以这个板:

|0 9 0| |0,0,0| |0,0,6|
|0 0 0| |9,6,0| |4,8,5|
|0 0 0| |5,8,1| |0,0,0|

|0,0,4| |0,0,0| |0,0,0|
|5,1,7| |2,0,0| |9,0,0|
|6,0,2| |0,0,0| |3,7,0|

|1,0,0| |8,0,4| |0,2,0|
|7,0,6| |0,0,0| |8,1,0|
|3,0,0| |0,9,0| |0,0,0|

将由以下字符串编码:

090000006000960485000581000004000000517200900602000370100804020706000810300090000

开发

其中包括一个makefile,以简化一些常用命令的运行。

安装本地开发的要求:

make requirements

要与覆盖率报告和linting一起运行测试,请执行以下操作:

make test

要在本地安装软件包进行测试:

make install

运行基准:

make benchmark

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java WebClient请求级别超时抛出名为default onErrorDropped的运算符   java JAXB外部绑定文件错误   Freemarker中的java转义宏参数值   java正在同步来自不同对象{已编辑}的线程   java如何在另一个类上更新活动中的元素   java Hibernate连接查询   java可以使用Apache Crunch创建类似于图形的数据结构吗?   java在JLabel的开头加上3个点   java 安卓应用程序显示线程错误   java@RequestBody在Spring中总是空的   java Android异步任务永远不会结束   具有多个属性的java Jaxws枚举   java中的安卓 Stripe InvalidRequestException   多线程java。util。非多线程程序中的ConcurrentModificationException   Minecraft Java插件如何删除HashMap中存储的所有块   空Java字符串的大小   从AJP连接器请求检索Shibboleth属性的java   oracle11g将Java类文件加载到Oracle数据库