Giter Site home page Giter Site logo

mikavilpas / squanmate Goto Github PK

View Code? Open in Web Editor NEW
17.0 3.0 4.0 6.38 MB

Square-1 trainer, analysis and general learning tool

Clojure 86.26% HTML 1.05% CSS 0.98% C++ 10.86% Shell 0.07% C 0.18% JavaScript 0.60%
clojurescript figwheel html5-canvas react reagent quil devcards

squanmate's Introduction

logo

Squanmate is a Square-1 trainer, analysis and general learning tool.

You can run it with a modern web browser right now. Try it here! (the link will change with every release, so always open it from this readme file!)

Squanmate can help you:

  • Train your cubeshape (or cubeshape parity) skills
    • select the combinations of shapes you would like to train
    • a random scramble is generated for you. Solve away!
    • repeat the selected case with the same/opposite parity, to train both cases effectively!
    • enable an optional inspection timer to see if you can determine the parity of your puzzle within 15 seconds
  • Train algorithms
    • like with cubeshape cases, select the cases you want to train
    • supported algsets:
      • cubeshape (square square) even & odd parity scrambles
      • edge permutation (EP)
      • permute last layer (PLL)
      • Lin corner permutation
      • Lin PLL+1 (source)
    • cases are split into even and odd parity cases for your convenience.
  • Learn and remember all different shapes and their names
  • Inspect a scramble
    • check whether the scramble gives an odd or even parity count and see exactly what the count consists of.
    • rotate the scramble how you like
    • link to a scramble so that it can be returned to later.
  • Display cubeshape algorithms and the shapes the algorithm goes through
    • it's a good aid for memorizing algorithms!
    • link to your created visualizations from e.g. your Google Sheets
  • Cubeshape parity helpers. If you use Cale Schoon's cubeshape parity method, Squanmate offers a couple of helpful features:
    • displays whether your entered algorithm is even or odd for that specific starting count position
    • allows you to find a more comfortable count position by rotating either layer for counting, then undoing that rotation for the algorithm. It's really easy to find out interesting things this way. For example, did you know that for all kite cases every sliceable position for a kite layer gives the same count?
  • Import a cubeshape algorithm. Say you have a cool alg that you would like to inspect or verify with Squanmate. Enter your alg into the Cubeshape algorithm importer and it will be recognized with minimal work on your part. I use this to import the cubeshape algs originally made for the more popular blind tracing CSP method.
  • Inspect all possible parity count positions for all shapes. When counting your parity, it's possible to start at multiple positions and still get the same result. Having options for counting will come in handy when your scramble orients the layers uncomfortably.
  • Train your skills in recognizing parities in color sequences. See the Squanmate algorithm document below for details on how color sequences contribute to the parity of the puzzle.

Related Square-1 learning resources

  • I have collected all cubeshape parity algorithms for the Cale Schoon method. If you use that method, take a look at my algorithms at Google Sheets
  • I use a simple but effective method for solving the Square-1. If you want to take a look, here are my Lin method algs

Development instructions

Master: Build Status: master Develop: Build Status: develop

As for dependencies, you need a clojure development environment. Check out figwheel, then start hacking something!

  • To start figwheel in your REPL, evaluate this
    (do (require 'figwheel-sidecar.repl-api)
        (figwheel-sidecar.repl-api/start-figwheel!)
        (figwheel-sidecar.repl-api/cljs-repl))

Java 9

If you’re using JDK 9, you need to include the JVM options "--add-modules" "java.xml.bind" in your project.clj. Add it just to the existing one that the line fully reads :jvm-opts ["--add-modules" "java.xml.bind" "-Xmx1G"]. Do not commit this, as it breaks <Java 9 JVMs.

Development environments

You have the option of choosing between two development environments:

  • devcards shows tests and isolated reagent components, allowing you to manipulate both without seeing the main application at all (think "sandbox"). It can be accessed at http://localhost:3449/cards.html
  • dev is the main application, but can still be hot reloaded at will. Access it at http://localhost:3449/
  • prod is not really a development environment, but I'll mention it here anyway. If you build prod with (build-once prod), it will actually be shown in the place of the dev build. Do a ctrl+f5 reload to force a change between the prod and dev "environments" just to be sure.

How to run tests

The tests are compiled to JavaScript and then run in a headless environment. To run the tests:

How to preview live changes on multiple devices

It's possible, thanks to figwheel magic, to hot reload your code changes e.g. on your main development desktop/laptop and your mobile device at the same time.

To do this,

  • be on the same network as your host (e.g. on your home network)
  • eval (switch-to-build ...) with the id of your build (devcards / dev)

Build production js

In the repl, run (build-once prod). The output file is tracked by git, so it will show up as changed in your git status. Commit the changed file to the repository so that the app works online with the newest version.

squanmate's People

Contributors

bmusin avatar mikavilpas avatar

Stargazers

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

Watchers

 avatar  avatar  avatar

squanmate's Issues

Generated image name from the shape visualizer should have another format

Currently it’s e.g. "squanmate-Wed Mar 21 2018 17_19_19 GMT+0100 (W. Europe Standard Time).png". When I now generate a new image after midnight it will start with "squanmate-Thu" and will be sorted before the image that was generated first because I sort alphabetically. Something like"2018-03-21" would be much better.

I inserted way too many wrong images because of this into my alg sheet :D I now regularely delete all these images in my download folder as I don’t want to change my default download folder in Chrome just for this and also I don’t want to change how this folder is sorted. So changing the format would be the most pleasing and easiest solution for me.

Scramble Inspector does not work anymore with 6.7

I get this in the console when I try to inspect a scramble either from the cubeshape trainer with Inspect or by entering my own scramble.

squanmate.js:3924 Error rendering component (in nu > page > pK > pK > nK > kK > iK > EJ)
(anonymous) @ squanmate.js:3924
squanmate.js:3453 Uncaught Error: No protocol method IDeref.-deref defined for type string: (4,5)/
at x (squanmate.js:3440)
at B (squanmate.js:3453)
at Object.EJ [as reagentRender] (squanmate.js:4445)
at squanmate.js:3922
at rt (squanmate.js:3923)
at squanmate.js:3924
at Ks (squanmate.js:3900)
at Ls (squanmate.js:3901)
at it (squanmate.js:3921)
at Object.render (squanmate.js:3924)
2squanmate.js:4013 ERROR: Cannot create sketch. :host is not specified.

Allow offline use

There's nothing preventing offline use after an initial load of the application. I haven't really tried it yet, so it might need work.
Use case: initial load and then the user's Internet connection breaks.

Show whether the current algorithm swaps or preserves parity

Can be done for algs that lead into cubeshape (square square):

  • start with a solved puzzle (obviously at even parity)
  • apply the given alg in reverse
  • do a parity count with Cale Schoon's method

If the count is odd, applying that alg at that position will always swap the parity count (swap the parity). Otherwise it will preserve the parity.

This is really simple, and can make designing algorithms and count positions a lot easier!

Hotkeys for parity game

Add hoykeys for the buttons odd/even. I would go with left and right arrow keys. It is annoying to always have to click and would be much faster with hotkeys.

Only fill second dropdown with possible shapes in algorithm shape visualizer

I’m not sure if it is necessary to create an image for, lets say 8/8 or star/star that is not possible with a Square-1. Should be easy to implement, just count the number of edges and corners in the first selected dropdown and then filter in the second.

But might be a UI nightmare :D Maybe you could disable the second dropdown until the first is filled and also add a switch button to the right to switch top with bottom and vice versa.

Extra commas in algorithms should throw an error

For example in the algorithm shape visualizer https://rawgit.com/sp3ctum/squanmate/master/resources/public/#/shape-visualizer/square/left-pawn/(-5%2C-4)/(-1%2C0)%2F1%2C0%2F0%2C-2%2C%2F-1%2C-2%2F

Screenshot for later when this is fixed
image

Notice the extra comma in 0,-2,/. I accidentally wrote that and could not figure out for a long time why the images were not generated for a part of the algorithm :D I would suggest, that Squanmate should check for multiple commas between two slashes and if it’s illegal, just throw an error as an unsliceable position does. I guess Squanmate does already do something like this because the visualization just stops because of an error I guess.

This is not only in the alg shape visualizer but also the scramble inspector. If I enter 1,0/-1,0,/-3,0/ I get just
image

Not only commas are a problem, but every other illegal character. If you already check if something in the algorithm is legal and get no as an answer, just pass the error to the user.

Follow usage amounts

I'm interested in seeing how many people find this a useful addition to their hobby. There's almost no interaction with the users at the moment.

Parity scrambler should check if end result is sliceable

I got a 8/star scramble ending with … / (1,4) which is not a legal position and you cannot get in an official scramble. I tracked it down in the code but have never worked with Closure (otherwise I would have tried to fix it myself) and I believe the problem is in default_scrambler.cljs#L24 that is used by new-default-shape-scrambler without checking after if the state is sliceable.

Scramble images not shown initially on firefox

When you enter the app with firefox, the images are not visible.

If you go to the page "All shapes" and then go back to the main page, the images are visible, and they will continue to be visible too.

PBL Trainer

I think a PBL trainer would be pretty cool, and I think there might be a good way to do it.
https://www.youtube.com/watch?v=5etIKH9fkqg is a PBL generator. It solves every PBL case (I think) with just two aux algs, both of them being 5 or less slices. For a trainer, you can give a scramble which is just two aux algs. You can do a random aux alg, random U and D turns and then another aux alg and that should theoretically cover every PBL (no parity of course) in scrambles just 10 slices or less. If you download the PBL finder, it comes with a notepad (auxAlgs_table) with every aux alg on it, which can hopefully be applied to squanmate. What do you think of this idea?

Rarely, the scrambler spits out an illegal scramble with a missing /

Just got this with 6.4 when training CSP
image

/ is missing and it also becomes unsliceable. Never had this before and also no idea how to reproduce this. I had 6/90 shapes selected (the first 6 Square shapes from your Google Sheet) and generated a new scramble by pressing New scramble

Squanmate should not put a space after a / when showing algorithms

Squanmate always puts a space after a / in Sq1 notation. This has been bugging me a lot since I started using Squanmate but I was always too lazy to open an issue.

E.g. when importing a scramble I enter 1,0/-1,0/ and after the import Squanmate displays
image

So it is transformed to (1,0)/ (-1,0)/. Happens also in the algorithm shape visualizer and everywhere else where algs are shown. Either also make a space before the / or neither before or after (I think I prefer the one without spaces. I tested both versions by changing the HTML with the DevTools and it is still readable without the spaces and more compact=better).

Btw: I like the new asterisk that shows when we leave the cubeshape :) My hand/brain coordination already tells me this when reading the last numbers before we leave cubeshape because I’ve done thousands of scrambles but I still like it :)
Edit: ok just saw the highlighting. I don’t like that at all <.< Just because text selection can be done by the user and is used for something else already (a user action, not normally something an application does).

Set focus to second field after entering first shape in shape visualizer

image (this little symbol is from a Chrome extension btw)
After that, I press enter or leftlick and the focus should automatically switch to the field to enter the shape for the bottom layer.

I can’t think of a situation where this would not be user friendly but maybe there is. If that’s the case, please tell me, maybe I can come up with another solution.

Add keyboard shortcuts for trainers

There is a great framework for using page-wide keyboard shortcuts in place, but only one page uses it so far (the parity game).

Currently the UI is slightly geared towards a mobile device. Laptop / desktop users might benefit a lot from easy to use keyboard bindings.

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.