Skip to main content

virtual-sq1

pip install virtual-sq1


Python module that simulates a Square-1 twisty puzzle

Build Coverage Status PyPI - Python Version

Usage

Import and create Square1 object

Solved by default.

from virtual_sq1 import Square1


my_square_1 = Square1()

View Square1's current state

virtual_sq1 uses (almost) the same position notation as Jaap's Square-1 optimiser.

Don't know how to read it? Click here!

my_square_1 = Square1()

print(my_square_1)
# A1B2C3D4-5E6F7G8H

Apply an algorithm to Square1

my_square_1 = Square1()

my_square_1.apply_alg("/ (3,0) / (-3,-3) / (0,3) /")

print(my_square_1)
# A1C3B2D4-5E7G6F8H

Apply a case to Square1

Changes the Square1's state so that the input algorithm brings it to its current state.

my_square_1 = Square1()

my_square_1.apply_alg("/ (3,0) / (1,0) / (0,-3) / (-1,0) / (-3,0) / (1,0) / (0,3) / (-1,0)", True)

print(my_square_1)
# A2B3C1D4-5E6F7G8H

The distinction between a "case" and an "algorithm" was made by Tyson Decker's puzzle-gen

Apply a specific state to Square1

my_square_1 = Square1()

my_square_1.apply_state("ABCDEF GH12345678 /")

print(my_square_1)
# ABCDEF/GH12345678

Apply a individual moves to Square1

Not sure why you'd do this when you could just use apply_alg but... it's an option.

my_square_1 = Square1()

my_square_1.slash()  # a slice/slash move
my_square_1.top.turn(-3)  # turn the top layer -3
my_square_1.bottom.turn(3)  # turn the bottom layer 3
my_square_1.slash()  # a slice/slash move
my_square_1.top.turn(3)  # turn the top layer 3
my_square_1.bottom.turn(-3)  # turn the bottom layer -3
my_square_1.slash()  # a slice/slash move

print(my_square_1)
# C3B2A1D4/5E8H7G6F

Credits

This module was highly inspired by the following:

Release files for virtual-sq1 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for virtual-sq1 1.1.0
File Size Uploaded
virtual_sq1-1.1.0.tar.gz 17.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for virtual-sq1 1.1.0
File Interpreter ABI Platform
virtual_sq1-1.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 36.1 kB

Release files / virtual_sq1-1.1.0.tar.gz

Download URL virtual_sq1-1.1.0.tar.gz
Size 17.9 kB
Tags Source
SHA-256 checksum
How to use checksums
ef4bebb42d74aafa56749e050a304474580cb50c02677a5f5455db00ffaae87d
BLAKE2b-256 checksum
How to use checksums
9b56b1774223938d90111269c88373d344767f24ed7ebe8fc58f4b861535fad1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.13.1

Release files / virtual_sq1-1.1.0-py3-none-any.whl

Download URL virtual_sq1-1.1.0-py3-none-any.whl
Size 18.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8a8bb5464535e885977dab96bb4e5271c91ae411bbd1138b66493e68d9692db7
BLAKE2b-256 checksum
How to use checksums
bd5a2ed50925cc79e59a7ae9c49080651360c092e3c8c9adc9bf6a2c5177f59c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.13.1

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page