Home Command line utilities Now You Can Play Rubik’s Cube Puzzle In Terminal

Now You Can Play Rubik’s Cube Puzzle In Terminal

By sk
Published: Last Updated on 831 views

Rubik's Cube game needs no introduction, right? It is a 3-D combination puzzle game invented by Ernő Rubik, a Hungarian sculptor and professor of architecture, in 1974. It is one of the best puzzle game invented so far to enhance the problem-solving skills of the kids and adults. If you're one Rubik's Cube lover, you don't need to buy it online or from a shop. You can play it right from the Terminal. Meet NRubik, an N-Curses based, virtual Rubik's Cube written in Python. If you're a hardcore CLI user who lives on Terminal all day, NRubik will certainly make your time useful.

Install NRubik

NRubik is nothing but a simple python script that works with both python2 and python3. It will work on most Unix-like operating systems that supports python 2 or python 3. So. make sure you have installed python in your system.

Installing NRubki is trivial. All you have to do is clone the repository, make it executable and place it in your /bin/ folder. It's that simple!

Git clone the NRubik repository:

$ git clone https://github.com/cheertarts/nrubik.git

The contents of NRubik's repository will be cloned in a directory called "nrubik" in your current working folder. cd into that directory:

$ cd nrubik

Make it executable:

$ chmod +x nrubik

To install globally, copy the executable file to /usr/bin/ folder:

$ sudo cp nrubik /usr/bin/

To install locally (this might not work depending on the machine), copy the executable file to $HOME/.local/bin/ folder:

$ cp nrubik $HOME/.local/bin/

That's it. NRubik has been installed. Now, it's time to solve the puzzle.

Play Rubik's Cube Game In Terminal

Type the following command to launch NRubik:

$ nrubik

You'll be pleased with a screen something like below.

Rubik's Cube Puzzle In Terminal

Rubik's Cube Puzzle In Terminal

As you can see in the screenshot, all options are self-explanatory.

There are 6 color faces:

  • W - White
  • Y - Yellow
  • O - Orange (Magenta)
  • R - Red
  • G - Green
  • B - Blue

You can turn them all with the given keybindings.

  • W - Turn top clockwise
  • X - Turn bottom clockwise
  • A - Turn left clockwise
  • D - Turn right clockwise
  • S - Turn front clockwise
  • E - Turn back clockwise

To hide/show the help section, press "H". To Mix up or scramble the faces, press "M". To quit this puzzle, press "Q". If you've solved Rubik's Cube already in real time, it might seem bit difficult to solve it virtually. Even though it is bit challenging, but possible to solve.

Have fun!


Thanks for stopping by!

Help us to help you:

Have a Good day!!

You May Also Like

Leave a Comment

* By using this form you agree with the storage and handling of your data by this website.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

This website uses cookies to improve your experience. By using this site, we will assume that you're OK with it. Accept Read More