Giter VIP home page Giter VIP logo

puzzle-gen's People

Contributors

tdecker91 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

rafalnawojczyk

puzzle-gen's Issues

Implementing Pattern Recognition for OCLL

image

For OLL cases where the edges are all oriented, there are 7 possible cases, and above is one of them (commonly named "U" OCLL). The full 7 OCLL names would be U, T, L, H, Pi, S, AS. There can be 4 possible angles for this but they're relatively the same, so accounting for a U/U'/U2 turns from that position, an OCLL can have 4 different angles, and working from there, the 7 initial OCLL states can be expanded to 7 * 4 = 28 shapes.

Is it possible for PuzzleGen to output some kind of text/ store some text in a variable that shows what OCLL cases you generated? Strictly for the oriented edges case, so we can just check the color of the corners that faces up. Like for example,

  1. Check how many corner that has the upper layer corner that faces up.
  2. If there is none, it has to be H or Pi. check the orientation of the rest of the corners to decide.
  3. If there is 1, it's has to be S or AS. Again, check the orientation of the rest of the corners to decide.
  4. If there is 2, check if the corners are adjacent of each other. If it is opposite, it can only be L. If they're adjacent, check the orientation of the rest of the corners to decide.

Will something like that be possible to implement? Thank you for your time for this!

Best,
Adi

Pyraminx 4+5 but also Megaminx 3+ does nothing?

Eg this. A Pyraminx with size 4 and Alg R and Case L => but shows a solved pyramid?

Tested on your test site [https://tdecker91.github.io/puzzlegen-demo/](tdeck91 Demo)

`let type = "pyraminx";
let options = {
  "width": 500,
  "height": 500,
  "puzzle": {
    "alg": "R",
    "case": "L",
    "size": 4
  }

"Cannot use import statement outside a module" syntax error from inside puzzle-gen

Trying to use this library in a svelte component, getting an error from inside the dist:

Cannot use import statement outside a module

/home/trexrush/dev/personal/cubing/node_modules/.pnpm/[email protected]/node_modules/sr-puzzlegen/dist/lib/index.js:1
import { TurnType } from "./algorithms/algorithm";
^^^^^^

SyntaxError: Cannot use import statement outside a module
    at Object.compileFunction (node:vm:352:18)
    at wrapSafe (node:internal/modules/cjs/loader:1027:15)
    at Module._compile (node:internal/modules/cjs/loader:1063:27)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:975:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:170:29)
    at ModuleJob.run (node:internal/modules/esm/module_job:198:25)
    at async Promise.all (index 0)
    at async ESMLoader.import (node:internal/modules/esm/loader:385:24)

relevant code:

import { CubeOptions, PNG, Type } from "sr-puzzlegen"
// ...
const newImage = (node: HTMLElement) => {
    let type: Type = Type.CUBE_TOP
    
    PNG(node, type, {})

    return {
        destroy(){}
      }
    }
//...
<div use:newImage /> 

same error occurs without a use directive too.
edit: code is irrelevent, the mere act of importing causes the issue

initial google search yields this SO post, which suggests:

though since the package is a commonJS package, alternatively publish as both cjs and esm? or just explicitly define the package as a cjs module

do you have any ideas here? This is the only library with a megaminx visualization that fits my use case, I have until now been using your visualcube fork sr-visualizer which doesnt have this issue.

im not too familiar with dealing with dependencies in the js environment, so apologies if this isnt framed correctly.

Text over sticker

Add the ability to overlay text over stickers.

This should be possible in svg mode. Probably also in canvas mode. This would be useful for adding labels to pieces besides just arrows.

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.