Skip to content

Latest commit

 

History

57 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cube

spinning cube (and the other platonic solids)

get it: gentoo | nix | brew | source

usage:

usage: cube [option]

options:
  -h, --help          show this help

shapes:
  -c, --cube          (default)
  -t, --tetrahedron
  -o, --octahedron
  -d, --dodecahedron
  -i, --icosahedron

q or esc quits

if you're on gentoo:

emerge --ask app-eselect/eselect-repository
eselect repository add noahburchell git https://github.com/noahburchell/noahburchell-overlay.git
emaint sync --repo noahburchell
emerge --ask app-misc/cube
cube --help

if you have brew:

# you need xcode 16.3+ (apple clang 17)
brew install noahburchell/cube/cube

if you have nix:

run it without installing anything:

nix run github:noahburchell/cube
nix run github:noahburchell/cube -- --icosahedron

install it into your profile:

nix profile install github:noahburchell/cube

or add it to a flake:

{
  inputs.cube.url = "github:noahburchell/cube";

  # then, in your config:
  #   environment.systemPackages = [ inputs.cube.packages.${pkgs.system}.default ];
  # or, with the overlay:
  #   nixpkgs.overlays = [ inputs.cube.overlays.default ];
  #   environment.systemPackages = [ pkgs.cube ];
}

hacking it (drops you in a shell with a compiler, make, bear, clangd and a debugger):

nix develop
make

os support status:

  • linux ✅
  • macos ✅
  • windows ❌

distro packaging status:

  • gentoo ✅
  • brew ✅
  • nix ✅
  • arch ❔ (i made the PKGBUILD, but AUR account registrations are closed)
  • everything else ❌

if you're on something else (apart from windows):

you have to build it

dependencies:

  • linux, macos, or a bsd
  • make (gmake on the bsds)
  • gcc 14+ or clang 19+

macos:

you need xcode 16.3+ (apple clang 17). older xcode accepts -std=gnu23 but has no c23 constexpr, so the build will fail. if that happens:

brew install llvm
make CC="$(brew --prefix llvm)/bin/clang"

homebrew gcc works too.

bsd:

run gmake, not make.

freebsd 14.2+ has a new enough clang in base. on openbsd and netbsd, install one from packages/pkgsrc and the makefile will find it on its own: it looks for clang19, clang20, gcc14, gcc15 and egcc on path.

get the source

grab the release tarball:

curl -LO https://github.com/noahburchell/cube/archive/refs/tags/v1.2.tar.gz
tar xf v1.2.tar.gz
cd cube-1.2

or clone the repo:

git clone --depth 1  https://github.com/noahburchell/cube.git
cd cube

build it:

make -j"$(nproc 2>/dev/null || sysctl -n hw.ncpu)"
sudo make install
cube --help

make install puts the binary in /usr/bin by default. so if you don't have root, or you just don't want it there:

make install PREFIX="$HOME/.local" # make sure its in path

configuration

are you unhappy with the characters i chose for shading?

  • change them in shapes.c, it should be clear how to do so

do you want the shapes to spin faster/slower?

  • spin period was chosen for a reason. changing it may introduce stutter

demo

demo? just install it! you will like it im sure

seriously, the demo gif is outdated and i havent gotten around to updating it. it will be updated soon

contact

if you have any questions contact me: cube@nburch.org

license

GNU General Public Licence v3.0

About

spinning cube (and platonic solids) in the terminal

Resources

Stars

6 stars

Watchers

4 watching

Forks

Releases

Contributors

Languages