Comments (1)
We "simulated" the inheritance. As a result, there is a higher level function run()
to call:
def run(puzzle_type: str, puzzle_content: str) -> str:
"""Run the solver."""
module = modules[puzzle_type]
if not hasattr(module, "encode"):
module.encode = encode
if not hasattr(module, "solve"):
raise NotImplementedError("Solver not implemented.")
if not hasattr(module, "decode"):
module.decode = decode
puzzle_encoded: Encoding = module.encode(puzzle_content)
solutions_encoded: List[Dict[str, str]] = module.solve(puzzle_encoded)
solutions_decoded: str = module.decode(solutions_encoded)
return solutions_decoded
from noqx.
Related Issues (20)
- [Dev/Bug] Fivecells/Fourcells diverge HOT 1
- [Bug] Shikaku optimization doesn't consider all rectangles has only one number HOT 1
- [Refactor] parameter change for count-relevant functions
- [Deps] Change to FastAPI/starlette backend
- [Refactor] refactor on the javascript loading process HOT 1
- [Feature] Use penpa-edit instead of pzprv3 HOT 2
- [Bug] Onsen-Meguri solver cannot parse two clues in an area HOT 1
- [Bug] Global connection is not checked on Hashi puzzles HOT 1
- [Bug] Haisu puzzle cannot solve when S and number clues are in the same area HOT 1
- [Feature] Support URL loading in examples HOT 1
- [Feature] Support question marks in some logic puzzles HOT 1
- [Feature] Support search box in puzzle type selections HOT 1
- [Feature] Change the backend from FastAPI to starlette to remove some redundant dependencies HOT 1
- [Feature] Add asterisk constraint in nonogram
- [Bug] Avoid no shaded cells in Yajikazu solver HOT 1
- [Feature] Add Cocktail Lamp Solver HOT 1
- [Feature] Add Paintarea Solver HOT 1
- [Feature] Add Tilepaint Solver HOT 1
- [Feature] Add Aquapelago Solver HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from noqx.