mgatelabs / genshinsolvers Goto Github PK
View Code? Open in Web Editor NEWWebApp to solve Genshin Impact Cube puzzles without the hassle
License: Apache License 2.0
WebApp to solve Genshin Impact Cube puzzles without the hassle
License: Apache License 2.0
Need to come up with a map to display that won't infringe on copyrights for the regions of inazuma.
Issues
At this point, the website has been developed much further than the Java application. Would it be reasonable to move it to the master branch (and move the Java application to a different branch)?
Also, there is an option to set a website for a repository when you go to https://github.com/mgatelabs/GenshinSolvers and click on the cog in the top right.
Puzzle is working, needs finishing touches
https://mgatelabs.github.io/GenshinSolvers/puzzle?id=x14204
Need to come up with a definition file to store the cubes.
{
"items":[
{
"type":"spin",
"x":"0",
"y":"0",
"count":"4",
"faces": ["N","S","E","W"],
"connections": [[1],[0,2],[1,3],[2]],
"solution": [0,1,2,1],
"placement": [[200,150], [100, 400], [300, 200], [150, 75]],
"comment": "not ready"
}
],
"version": "1",
"comments": ["", "", ""]
}
faces: direction / number of lights
connections: for each cube, when touched, it touches these other cubes
solution: the solution for the default configuration
placement: where the position the cube in the page, so it kind of looks like how the puzzle exists in the picture.
The fact that this solver is calling a random number generator makes me think that it simply tries out stuff until something works. Is that assessment correct?
An even more overblown well engineered approach would be to try out all possibilities in a breadth-first manner. In fact, I did write something like this. And since nobody said anything about being reasonable, I wrote it in Haskell.
Pro:
It's super short and works beautifully
Con:
It's in Haskell. Not sure if that's better or worse than Java.
type Cube = Int
type Step = Int
type PossibleRotation = [Int] -- As long as the cube array
data State = S [Step] [Cube]
solvePuzzle :: [State] -> [PossibleRotation] -> [Step]
solvePuzzle states possibleRotations
| null solutions = solvePuzzle (concatMap (\s -> zipWith (applyRotation s) possibleRotations [0..]) states) possibleRotations
| otherwise = getSteps (head solutions)
where solutions = filter (\(S _ cubes) -> all (==0) cubes) states
getSteps :: State -> [Step]
getSteps (S steps _) = steps
applyRotation :: State -> PossibleRotation -> Int -> State
applyRotation (S steps cubes) rotation rotationId = S (steps++[rotationId]) (zipWith (\cube rot -> (cube + rot) `mod` 4) cubes rotation)
-- solvePuzzle [(S [] [0,2,0,0])] [[1,1,0,1],[1,1,1,0],[0,1,1,1],[1,0,1,1]]
-- solvePuzzle [(S [] [0,2,0,0])] [[1,1,0,1],[1,1,1,0],[0,1,1,1],[1,0,1,1]]
Feel free to use the code. Though, if one wants to make something actually usable, I'd recommend writing it in Typescript and having a proper, static website. I'd totally be willing to help if you're interested.
Verify with https://www.youtube.com/watch?v=8GuxK3FrRCE 11:18
The current version isn't working on iOS Safari.
Actually it is all safari browsers. Something to do with a THREE that hasn't been resolved.
https://stackoverflow.com/questions/66941849/chunkloaderror-in-angular-threejs-app-only-on-safari
Development mode works, so possibly it is an issue with the compressor breaking something in THREE JS
https://mgatelabs.github.io/GenshinSolvers/puzzle?id=x19254
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.