<commit_before>[![PyPI version](https://badge.fury.io/py/pazudorasolver.svg)](https://badge.fury.io/py/pazudorasolver)
[![Supported Python Versions](https://img.shields.io/pypi/pyversions/pazudorasolver.svg)](https://pypi.python.org/pypi/pazudorasolver/)
[![Build Status](https://travis-ci.org/ethanlu/pazudora-solver.svg?branch=master)](https://travis-ci.org/ethanlu/pazudora-solver)
[![Codacy Badge](https://api.codacy.com/project/badge/grade/78cdfdafa28f4475a3dea086c3dd006d)](https://www.codacy.com/app/ethanoks/pazudora-solver)
[![Code Climate](https://codeclimate.com/github/ethanlu/pazudora-solver/badges/gpa.svg)](https://codeclimate.com/github/ethanlu/pazudora-solver)

Pazudora Solver
=====

Python-based solver for the [Puzzles and Dragons mobile game](http://www.gunghoonline.com/games/puzzle-dragons/).
Inspired by the [Javascript version](https://github.com/alexknutson/Combo.Tips) on [Combo.tips](http://combo.tips/)

### Example
```python
from pazudorasolver.board import Board
from pazudorasolver.piece import Fire, Wood, Water, Dark, Light, Heart, Poison, Jammer, Unknown
from pazudorasolver.heuristics.greedy_dfs import GreedyDfs
from pazudorasolver.heuristics.pruned_bfs import PrunedBfs

weights = {Fire.symbol: 2.0,
           Wood.symbol: 2.0,
           Water.symbol: 2.0,
           Dark.symbol: 2.0,
           Light.symbol: 2.0,
           Heart.symbol: 1.0,
           Poison.symbol: 0.5,
           Jammer.symbol: 0.5,
           Unknown.symbol: 0.0}

board = Board.create_randomized_board(5, 6)
matches = board.get_matches()

print board
print matches

solver1 = GreedyDfs(weights)
solution = solver1.solve(board, 50)

print solution

solver2 = PrunedBfs(weights)
solution = solver2.solve(board, 50)

print solution
```

### TODO
- Improve fragment score calculation
- Improve cycle detection when finding solutions
- Add benchmark app to compare various heuristics
- Add more heuristics for solving board<commit_msg>removed codeclimate and added coveralls badge<commit_after>[![PyPI version](https://badge.fury.io/py/pazudorasolver.svg)](https://badge.fury.io/py/pazudorasolver)
[![Supported Python Versions](https://img.shields.io/pypi/pyversions/pazudorasolver.svg)](https://pypi.python.org/pypi/pazudorasolver/)
[![Build Status](https://travis-ci.org/ethanlu/pazudora-solver.svg?branch=master)](https://travis-ci.org/ethanlu/pazudora-solver)
[![Codacy Badge](https://api.codacy.com/project/badge/grade/78cdfdafa28f4475a3dea086c3dd006d)](https://www.codacy.com/app/ethanoks/pazudora-solver)
[![Coverage Status](https://coveralls.io/repos/github/ethanlu/pazudora-solver/badge.svg?branch=master)](https://coveralls.io/github/ethanlu/pazudora-solver?branch=master)

Pazudora Solver
=====

Python-based solver for the [Puzzles and Dragons mobile game](http://www.gunghoonline.com/games/puzzle-dragons/).
Inspired by the [Javascript version](https://github.com/alexknutson/Combo.Tips) on [Combo.tips](http://combo.tips/)

### Example
```python
from pazudorasolver.board import Board
from pazudorasolver.piece import Fire, Wood, Water, Dark, Light, Heart, Poison, Jammer, Unknown
from pazudorasolver.heuristics.greedy_dfs import GreedyDfs
from pazudorasolver.heuristics.pruned_bfs import PrunedBfs

weights = {Fire.symbol: 2.0,
           Wood.symbol: 2.0,
           Water.symbol: 2.0,
           Dark.symbol: 2.0,
           Light.symbol: 2.0,
           Heart.symbol: 1.0,
           Poison.symbol: 0.5,
           Jammer.symbol: 0.5,
           Unknown.symbol: 0.0}

board = Board.create_randomized_board(5, 6)
matches = board.get_matches()

print board
print matches

solver1 = GreedyDfs(weights)
solution = solver1.solve(board, 50)

print solution

solver2 = PrunedBfs(weights)
solution = solver2.solve(board, 50)

print solution
```

### TODO
- Improve cycle detection when finding solutions
- Improve fragment score calculation
- Add benchmark app to compare various heuristics
- Add more heuristics for solving board
{'fraction_non_alphanumeric': 0.13765182186234817, 'fraction_numerical': 0.022267206477732792, 'mean_word_length': 4.4002732240437155, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 22, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3242278', 'n_tokens_mistral': 1527, 'n_tokens_neox': 1415, 'n_words': 246}