Skip to content

paarthmadan/cube

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cube Timer

A tui-based Rubik's cube timer written in Rust.

Cube demo

Cube demo in larger TMUX session

Instructions (pre-release)

git clone https://github.com/paarthmadan/cube && cd cube
cargo install --path .
cube
  1. Press Space to begin and end a solve
  2. Press q to exit the process

Still heavily in development – proper build and release instructions will be added shortly.

Feature List

  • Timer
  • Basic TUI
  • Scramble generator
  • Statistics
  • Solve graph
  • Persisting data across sessions (data written to ~/.cube/data.json)

Not yet implemented

  • Minimizing CPU usage
  • Toggling between different cube sessions
  • Custom configuration (colours etc.)
  • Optimizing UI for different frame sizes (right now it's ideally used in a small tmux pane off to the side :/)

How does it work?

  • Built on top of the tui-rs crate.
  • The process itself is really a glorified timer:
    • There are a few threads:
      • Keyboard Input
      • Redraw Interrupt Dispatcher
  • Communication between threads uses basic message passing – Rust has a nice paradigm for this called mpsc.
  • The main thread performs blocked-waiting for interrupts (events) spawned by other threads. Starvation isn't an issue because the redraw interrupt is dispatched at a fixed interval.
  • The tick rate for the process is currently set to 50, which would mean the process exhibits roughly 20FPS, which is sufficient.

Motivation

  • Practicing Rust
  • Applying some of the fundamentals learned from Operating Systems
  • Now I don't have to open my browser everytime I feel like cubing

Releases

No releases published

Packages

No packages published

Languages