Code Monkey home page Code Monkey logo

txt-cube's Introduction

txt-cube

Importable turnable cube with random state LSE scrambles and stuff. Currently without scrambles.

Why

For robots :)

Functions

  • Use lse_scr() to get a random state lse scrambled cube.
  • Use M, M2, Mp, U, U2, Up to solve the cube, or mix it up further!
  • Check against SOLVED_CUBE to see what it should look like when solved.

Example of usage

Solving the cube one or several moves at a time

>>> from txt_cube import *
>>> cube = lse_scr()
>>> cube
['Y', 'O', 'Y', 'Y', 'W', 'Y', 'Y', 'R', 'Y', 'R', 'R', 'R', 'B', 'B', 'B', 'B', 'B', 'B', 'G', 'W', 'G', 'R', 'O', 'R', 'R', 'O', 'R', 'O', 'B', 'O', 'G', 'G', 'G', 'G', 'G', 'G', 'B', 'W', 'B', 'O', 'R', 'O', 'O', 'G', 'O', 'W', 'Y', 'W', 'W', 'Y', 'W', 'W', 'Y', 'W']
>>> cube = Mp(Up(M(cube)))
>>> cube = U(cube)
>>> cube
['Y', 'G', 'Y', 'R', 'W', 'R', 'Y', 'W', 'Y', 'R', 'W', 'R', 'B', 'B', 'B', 'B', 'B', 'B', 'G', 'O', 'G', 'R', 'O', 'R', 'R', 'O', 'R', 'O', 'Y', 'O', 'G', 'G', 'G', 'G', 'G', 'G', 'B', 'Y', 'B', 'O', 'R', 'O', 'O', 'Y', 'O', 'W', 'Y', 'W', 'W', 'Y', 'W', 'W', 'B', 'W']
>>> cube = M(Up(M(cube)))
>>> cube == SOLVED_CUBE
True

Solving the same cube different ways

>>> cube1 = U2(M2(U2(SOLVED_CUBE)))
>>> cube2 = cube1
>>> M2(U2(M2(U2(M2(cube2))))) == U2(M2(U2(cube1)))
True

txt-cube's People

Contributors

jupilogy avatar

Watchers

 avatar  avatar

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.