tabrace - A game played by shell tab completion
This document describes version 0.006 of tabrace (from Perl distribution Games-TabRace), released on 2021-03-05.
To start playing the game:
% tabrace <enter>
To type a number (type digit marked by x):
% tabrace <tab> 0 1 2 3 4x 5 6 7 8 9 % tabrace 4<tab> 40 41 42 43 44 45 46 47x 48 49 % tabrace 47<tab> 470x 471 472 473 474 475 476 477 478 479 % tabrace 470<tab> 4700 4701 4702 4703 4704 4705 4706 4707 4708x 4709 % tabrace 4708<tab> % tabrace 4708 _<enter>
Welcome to tabrace, a game played with tab completion. You must first enable tab completion for your shell. Here's how to do it in the various shells:
bash
% complete -C tabrace tabrace
Or alternatively, install shcompgen from CPAN using cpanm -n App::shcompgen.
cpanm -n App::shcompgen
tcsh
% complete tabrace 'p/*/`tabrace`/'
zsh
Put a file named _tabrace containing the text below somewhere to your fpath:
_tabrace
fpath
#compdef tabrace _tabrace() { si=$IFS compadd -- $(COMP_LINE=$BUFFER COMP_POINT=$CURSOR tabrace) IFS=$si } _tabrace "$@"
fish
% complete -c tabrace -f -a '(begin; set -lx COMP_SHELL fish; set -lx COMP_LINE (commandline); set -lx COMP_POINT (commandline -C); tabrace; end)'
The objective of the game is to type 3 numbers as fast as possible. For each number, you type "tabrace " then press Tab (Tab) to see digits between 0 to 9. There's an 'x' next to the correct digit. Type the correct digit and press Tab (Tab) again to see the next digit. After all digits are typed, press Enter to clock in your time for the number. Your points will be determined from how fast you typed the number. Do the same for the rest of the numbers to get the total score.
Display help and exit.
Display version and exit.
Reset game.
Reset high scores.
Show high scores and exit.
Please visit the project's homepage at https://metacpan.org/release/Games-TabRace.
Source repository is at https://github.com/perlancar/perl-Games-TabRace.
Please report any bugs or feature requests on the bugtracker website https://github.com/perlancar/perl-Games-TabRace/issues
When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.
This game serves as a demo of the Complete module family, including Complete::Bash, Complete::Util, and so on.
perlancar <perlancar@cpan.org>
This software is copyright (c) 2021, 2016 by perlancar@cpan.org.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Games::TabRace, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Games::TabRace
CPAN shell
perl -MCPAN -e shell install Games::TabRace
For more information on module installation, please visit the detailed CPAN module installation guide.