An Open Source Java Library for the Rubiks Cube!

Overview

cubot

📑 Table of contents

  1. Overview
  2. What is Cubot?
  3. Why would you want it?
  4. Documentation
  5. Installation
  6. Updates

📔 Overview

A Java library to help you :

  • Virtually construct a Cube ( 2x2/3x3 ),
  • Quickly execute moves and perform algorithms seamlessly,
  • Manipulate the Cube using simple java,
  • Get the solution for the cube
  • Use a cube in your own projects

What is Cubot?

There are many Rubik's Cube-related graphic projects and solvers which implement various algorithms for solving the cube.
But programmers might not want something just for visualizing the cube, they might want a data-structure type of solution for them to use in their own projects without having to make their own files. Perhaps they want to only make a 3D cube with the help of a library. Cubot is a library meant for this very purpose.

🤔 Why would you want it?

With Cubot, you can

  • Virtually construct a Cube ( 2x2/3x3 ),
  • Quickly execute moves and perform algorithms seamlessly,
  • Manipulate the Cube using simple java,
  • Get the solution for the cube
  • Use a cube in your own projects
  • and so much more, with the help of the methods it provides

Now speed is relative, as we all know. But Cubot can scramble the Cube, print, solve the Cube, print, bring the cube back into the scrambled state and print again, in less than a second on average.

long startTime = System.nanoTime();

Cubot cube = new Cubot();
// "U2 F2 D2 U R' D2 B2 U L2 B' D' U2 F L F U' B' R' F' U F' U B L' D2 B R' B F2 R'" --> Offical WCA Scramble

cube.stringAlg("U2 F2 D2 U R' D2 B2 U L2 B' D' U2 F L F U' B' R' F' U F' U B L' D2 B R' B F2 R'") ;
// scrambles


Cubot cube2 = new Cubot(cube.cubeToArr()) ;
System.out.println(cube);
// prints output

String s  = cube.solve() ;
// solves

System.out.println(cube);
// prints ouput

System.out.println();

cube.reverseAlg(s, true) ;
// rescrambles with the solve again

System.out.println(cube);
// prints output

System.out.println("Re-scrambled ? = " + ((Cube3) cube.getCube()).solved((Cube3) cube2.getCube())) ;
// checks if the rescrambled cube is the same as the first scramble

long endTime = System.nanoTime();
long time = (endTime - startTime) ;
System.out.println("-----------------------------");
System.out.println("Execution time in milliseconds: " + time / 1000000);

Example Example

Head over to the Docs for more on Cubot and how to use it


⚙️ Installation

  1. Download the Cubot.jar (v1.0) file above ( <-- Old version. v2.0 coming at the end of the month )
  2. Go to your project on Intellij or Eclipse
  3. Click on Files on the top left corner, and then click on Project Structure

example

4. Now click on the Libraries option, and then choose the "+" button as shown in the image

example

5. You will get 3 options. Choose Java and then select Cubot.jar from the download location

example

🎉 Updates

  1. getScramble(int n) added; reverseAlg(String s) added; minor tweaks in Checker - 30.5.2021
  2. E(), S() added, updated Moves in moves - 31.5.2021
  3. Edash(), Sdash(), x(), y(), y'() + Optimized the big slice moves; solve(), stringalg(), reversealg() updated - 1.6.2021
  4. toString() improved to make it much easier to understand the cube-state ( check out the new output in Documentation ) - 2.6.2021
  5. Cube constructor updated ( Enter cube faces randomly now ) - 3.6.2021
  6. toString() bug fixed, pll() bug fixed- 11.6.2021
  7. 2x2 files added, 3x3 files made sep - 14.6.2021
  8. Merged src added, use single Cubot for both Cubes, Documentation and README updated - 15.6.2021
  9. cubeToString added for 2x2 - 22.6.2021
  10. cubeToString added to Cubot for both 2x2 and 3x3 - 25.6.2021
  11. wiki added for the repo, files updated, cubeToArr, toString, etc fixed - 28.6.2021
  12. documentation for 2x2 files done - 1.7.2021
  13. 2x2 solver added and documented - 2.7.2021
  14. 3x3 classes documented - 7.7.2021
  15. v2.0 published - 11.7.2021

Sites used

You might also like...

Java Statistical Analysis Tool, a Java library for Machine Learning

Java Statistical Analysis Tool JSAT is a library for quickly getting started with Machine Learning problems. It is developed in my free time, and made

Dec 20, 2022

JML - Java Math Library.

JML JML - Java Math Library. JML is a Java Math Library for solving Advanced Mathematical calculations. Disclaimer This project is under heavy develop

Sep 23, 2021

Tribuo - A Java machine learning library

Tribuo - A Java machine learning library

Tribuo - A Java prediction library (v4.2) Tribuo is a machine learning library in Java that provides multi-class classification, regression, clusterin

Dec 28, 2022

👄 The most accurate natural language detection library for Java and the JVM, suitable for long and short text alike

👄 The most accurate natural language detection library for Java and the JVM, suitable for long and short text alike

Quick Info this library tries to solve language detection of very short words and phrases, even shorter than tweets makes use of both statistical and

Dec 28, 2022

A library to check MIUI autostart permission.

MIUI Autostart A library to check MIUI autostart permission state. Supported versions MIUI 10 (firebase) MIUI 11 (physical device 11.0.9) MIUI 12 (phy

Jan 2, 2023

Library for helping mods that use graph networks, like Wired Redstone

GraphLib Library for helping mods that use graph networks, like Wired Redstone. GraphLib and HCTM-Base This library is based on HCTM-Base by 2xsaiko a

Nov 5, 2022

Hierarchical Temporal Memory implementation in Java - an official Community-Driven Java port of the Numenta Platform for Intelligent Computing (NuPIC).

htm.java Official Java™ version of... Hierarchical Temporal Memory (HTM) Community-supported & ported from the Numenta Platform for Intelligent Comput

Dec 1, 2022

An Engine-Agnostic Deep Learning Framework in Java

An Engine-Agnostic Deep Learning Framework in Java

Deep Java Library (DJL) Overview Deep Java Library (DJL) is an open-source, high-level, engine-agnostic Java framework for deep learning. DJL is desig

Jan 7, 2023
Releases(v3.0)
  • v3.0(Aug 14, 2021)

  • v2.0(Jul 11, 2021)

    • Cubot handles both 2x2 and 3x3
    • Solve methods added for both
    • All bugs in the previous solve method have been corrected
    • Solve code opitimized for quicker output
    • Scramble methods added
    • New print methods
    • More flexibility and parameters for almost all methods
    • New ways to manipulate the cube both directly and indirectly, have been added

    Cubot will handle the decision between holding 2x2 or 3x3. In other words, initialize like you used to, and in new quicker ways.

    Happy Cubing!

    Source code(tar.gz)
    Source code(zip)
    Cubotv2.0.jar(33.82 KB)
  • v1.0(May 24, 2021)

Owner
Akshath Raghav
Hello there! I'm Akshath, a high school senior from India. I love speed-cubing, speed-typing, photography, and anime!
Akshath Raghav
oj! Algorithms - ojAlgo - is Open Source Java code that has to do with mathematics, linear algebra and optimisation.

oj! Algorithms oj! Algorithms - ojAlgo - is Open Source Java code that has to do with mathematics, linear algebra and optimisation. General informatio

Optimatika 403 Dec 14, 2022
MathParser - a simple but powerful open-source math tool that parses and evaluates algebraic expressions written in pure java

MathParser is a simple but powerful open-source math tool that parses and evaluates algebraic expressions written in pure java. This projec

AmirHosseinAghajari 40 Dec 24, 2022
🔍 Open Source Enterprise Cognitive Search Engine

OpenK9 OpenK9 is a new Cognitive Search Engine that allows you to build next generation search experiences. It employs a scalable architecture and mac

SMC 24 Dec 10, 2022
CompreFace is a free and open-source face recognition system from Exadel

CompreFace can be easily integrated into any system without prior machine learning skills. CompreFace provides REST API for face recognition, face verification, face detection, landmark detection, age, and gender recognition and is easily deployed with docker

Exadel 2.6k Dec 31, 2022
DataLink is a new open source solution to bring Flink development to data center.

DataLink 简介 DataLink 是一个创新的数据中台解决方案,它基于 SpringCloud Alibaba 和 Apache Flink 实现。它使用了时下最具影响力的实时计算框架Flink,而且紧跟社区发展,试图只通过一种计算框架来解决离线与实时的问题,实现Sql语义化的批流一体,帮助

null 50 Dec 28, 2022
DataLink is a new open source solution to bring Flink development to data center.

DataLink 简介 DataLink 是一个创新的数据中台解决方案,它基于 SpringCloud Alibaba 和 Apache Flink 实现。它使用了时下最具影响力的实时计算框架Flink,而且紧跟社区发展,试图只通过一种计算框架来解决离线与实时的问题,实现Sql语义化的批流一体,帮助

null 39 Dec 22, 2021
A open-source addon for Meteor Client.

A open-source addon for Meteor Client

null 77 Dec 28, 2022
Use this to open hidden activities on MIUI.

miui_hidden_libs Use this to open hidden activities on MIUI. Translate for your language: https://drive.google.com/file/d/1---II4WVVvPIn3cPodTC52VPVG3

ios7jbpro 51 Nov 10, 2022
Open Standard for Metadata. A Single place to Discover, Collaborate and Get your data right.

What is OpenMetadata? Try our Sandbox Install & Run Documentation and support Contributors License What is OpenMetadata? OpenMetadata is an Open Stand

null 1.8k Dec 31, 2022