Skip to content

Improve CLI options and features

Compare
Choose a tag to compare
@samtay samtay released this 03 Jul 05:03

Added legitimate CLI options:

tetris - the iconic game right in your terminal

Usage: tetris ([-a|--ascii-only] | [-p|--preview-chars CHARS])
              [-l|--level LEVEL] [--high-score]

Available options:
  -h,--help                Show this help text
  -a,--ascii-only          Use '[]' as hard drop preview cell instead of '◤◢'
  -p,--preview-chars CHARS Custom two character preview cell
  -l,--level LEVEL         Specify level (unspecified results in prompt)
  --high-score             Print high score and exit

The main purpose of this release was to help people with terminals that don't handle my choice of unicode characters very well. This way a simple -a flag will sub in [] as a preview, or custom characters can be used as well. This prompted a nice-to-have -l level option so you can skip the first prompt.

And I got around to saving high score. Not a complete leaderboard with name entry, just a single highest score is saved for the user playing Tetris, so you can get a pat on the back when you break a new record.

And I moved from tuples to Linear.V2 since that's the proper datatype when dealing with points in space.