3D Rubik's Cube in Emacs
Go to file
Akib Azmain Turja ffc1c5bb5a
Add .dir-locals.el
2022-11-26 21:46:24 +06:00
.dir-locals.el Add .dir-locals.el 2022-11-26 21:46:24 +06:00
COPYING Add COPYING 2022-04-29 12:45:28 +06:00
README.org Lower required Emacs version and elaborate README 2022-05-15 19:10:02 +06:00
cube-shuffled.png Add the game 2022-04-26 19:35:55 +06:00
cube.el Use Unicode half block characters if available 2022-09-08 16:38:32 +06:00
cube.png Add the game 2022-04-26 19:35:55 +06:00


Cube - 3D Rubik's Cube in Emacs

Cube is a 3D Rubik Cube game. You can do whatever you want to do with the cube. Just install it and start with M-x cube.

/akib/emacs-cube/src/branch/master/cube.png /akib/emacs-cube/src/branch/master/cube-shuffled.png



Cube is not available on any ELPA right now.


(quelpa '(cube :fetcher git
               :url "https://codeberg.org/akib/emacs-cube.git"))


 '(cube :type git :repo "https://codeberg.org/akib/emacs-cube.git"))


First, install Eagle as described in its README. Then put cube.el in your load-path.


To rotate any of the six faces clockwise, call one of the following commands:

Key Command
f cube-rotate-front
b cube-rotate-back
l cube-rotate-left
r cube-rotate-right
u cube-rotate-up
d cube-rotate-down

If you want to rotate counter-clockwise, give single prefix argument (C-u) or negative argument (-) before the command. To rotate twice, either press the key twice or press give numeric argument 2 (2) and press the key once.

To shuffle the cube randomly, press S (cube-shuffle). You can use a custom seed yourself by calling it with prefix argument and entering the seed.

If you have scrambled the cube but can't solve, press R (cube-reset) to reset the cube.

To rotate the whole cube, you have the following commands and keybindings:

Key Command
up cube-camera-rotate-up
down cube-camera-rotate-down
left cube-camera-rotate-left
right cube-camera-rotate-right
M-up cube-camera-rotate-clockwise
M-down cube-camera-rotate-counter-clockwise
C-p cube-camera-rotate-up
C-n cube-camera-rotate-down
C-b cube-camera-rotate-left
C-f cube-camera-rotate-right
M-p cube-camera-rotate-counter-clockwise
M-n cube-camera-rotate-clockwise
B cube-camera-rotate-show-back
SPC cube-camera-reset-rotation

If, for some reason, you want to render the cube again, press g (cube-render).


The cube too big.

Increase camera distance by increasing the value of cube-camera-distance.

The cube is too slow.

Decrease resolution by setting cube-resolution. This will decrease the size of the cube, so you may want to increase the scale by increasing cube-scale.

The pixels are too big.

Increasing resolution by setting cube-resolution, or decrease scaling by setting cube-scale.

The animation is too long.

Decrease animation duration by setting cube-animation-duration. If this doesn't help then may be the number of animation step is too much to show in given time. In that case you need to decrease animation step by setting cube-animation-steps, or you may decrease resolution.