Git Product home page Git Product logo

genshinsolvers's People

Contributors

mgatelabs avatar stefnotch avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

genshinsolvers's Issues

Map Needed

Need to come up with a map to display that won't infringe on copyrights for the regions of inazuma.

  • Thinking to start go off the official map, and use snagit to create a large panoramic image.
  • Then from that image create a rough version without detail.
  • This should be enough to start working
  • Get the kids to create artwork to replace the images with actual art in it.

Issues

  • Unsure if it should include the entire map in general, there are no spin puzzles over there.
  • Are there X/Y coordinates in the game that are accessible, instead of just eyeballing where it would go?
    • Maybe just use the coordinates from the official map

Move Website to master branch

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.

image

JSON Definition File

Need to come up with a definition file to store the cubes.

Quick idea

{

  "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.

Bread-first search

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.