Skip to content

SrVariable/RubikCube

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RubikCube

Table of Contents

  1. Description
  2. Requirements
  3. Usage
  4. Movements
  5. How to Play

Description

Terminal Based Game of a Rubik's Cube. Each face is represented with a colored square emoji.

The colors available are:

  • 🟧 Orange (Up face)
  • 🟨 Yellow (Front face)
  • 🟩 Green (Right face)
  • 🟥 Red (Down face)
  • 🟦 Blue (Left face)
  • 🟪 Purple (Back face)

Requirements

  • git
  • gcc
  • make

Usage

Clone the repository

git clone https://github.com/SrVariable/RubikCube.git

Go to the cloned repository

cd RubikCube

Execute make

make

Run the program

./rubik

Movements

Uppercase movements Lowercase movements

Uppercase

  • B: Rotate the B face 90º counterclockwise.
  • F: Rotate the F face 90º clockwise.
  • L: Rotate the L face 90º counterclockwise.
  • R: Rotate the R face 90º clockwise.
  • U: Rotate the U face 90º clockwise.
  • D: Rotate the D face 90º counterclockwise
  • M: Rotate the middle layer parallel to the R and L faces 90º counterclockwise.
  • E: Rotate the middle layer parallel to the U and D faces 90º counterclockwise.
  • S: Rotate the middle layer parallel to the F and B faces 90º clockwise.

Lowercase

  • b: Rotate the B face and the middle layer parallel to the F and B faces 90º counterclockwise.
  • f: Rotate the F face and the middle layer parallel to the F and B faces 90º clockwise.
  • l: Rotate the L face and middle layer parallel to the R and L faces 90º counterclockwise.
  • r: Rotate the R face and middle layer parallel to the R and L faces 90º clockwise.
  • u: Rotate the U face and middle layer parallel to the U and D faces face 90º clockwise.
  • d: Rotate the D face and middle layer parallel to the U and D faces face 90º counterclockwise
  • x: Rotate the cube in the X axis 90º clockwise.
  • y: Rotate the cube in the Y axis 90º clockwise.
  • z: Rotate the cube in the Z axis 90º clockwise.

Note

Adding 2 after the letter will make the same movement twice. So B2 is the same as doing B B.

Adding ' after the letter will make the reverse movement. So B' is the same as doing B B B.

Reference: Rubik's Cube Move Notations

How to Play

When you run the program it will display the original position of the cube and will ask you to introduce a movement (listed before). You can introduce more than one movement in a single turn. For example:

Introduce a movement: B2FL'R

This will do B2, F, L', R.

Note

If you introduce more than one movement in a single turn, it will directly display the cube with the respective movements applied.

Tip

To undo a movement you have to type the opposite movement in reverse.

So in order to undo B2FL'R you will have to type R'LF'B'B'.

About

Play with a Rubik Cube in your own terminal!

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published