The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

tabnoun - Select nouns from list of words, as fast as possible

VERSION

This document describes version 0.004 of tabnoun (from Perl distribution Games-TabNoun), released on 2021-09-21.

SYNOPSIS

A sample session:

 % tabnoun

 Welcome to tabnoun, a game played with tab completion. You must first enable tab
 completion for your shell. Here's how to do it in bash:

     % complete -C tabnoun tabnoun

 Or alternatively, install shcompgen from CPAN using 'cpanm -n App::shcompgen'.
 For instructions on how to enable tab completion for other shells, see manpage.

 The objective of the game is to select nouns 7 times as fast as possible, each
 from a list of 5 words. For each noun, you type "tabnoun " then press Tab (Tab)
 to see the list of words. You can now select the noun by typing it manually or
 by completing it using tab completion. After that, press Enter to clock in your
 time for the noun. Your points will be determined from how fast you entered the
 noun. Do the same for the rest of the nouns to get the total score.

 I'm ready to play! Are you? Type "tabnoun" and press Tab (Tab) to start.

 % tabnoun
 actually     altogether   competition  educational  electronic
 % tabnoun competition
 You entered the 1st word in 2.280 sec(s). Good, but could be even better next time. You get 80 points.

 Ready for the next word? Type 'tabnoun <tab>' again.
 % tabnoun
 civil          educational    fully          improvement    unfortunately
 % tabnoun improvement
 You entered the 2nd word in 2.743 sec(s). Good, but could be even better next time. You get 80 points.

 Ready for the next word? Type 'tabnoun <tab>' again.
 % tabnoun
 beer        eventually  latter      sufficient  totally
 % tabnoun beer
 You entered the 3rd word in 1.558 sec(s). Excellent! You get 100 points.

 Ready for the next word? Type 'tabnoun <tab>' again.
 % tabnoun
 difficult    explanation  seriously    strongly     tiny
 % tabnoun explanation
 You entered the 4th word in 1.791 sec(s). Excellent! You get 100 points.

 Ready for the next word? Type 'tabnoun <tab>' again.
 % tabnoun
 extremely     greatly       introduction  powerful      remarkable
 % tabnoun introduction
 You entered the 5th word in 2.118 sec(s). Good, but could be even better next time. You get 80 points.

 Ready for the next word? Type 'tabnoun <tab>' again.
 % tabnoun
 childhood    consistent   equally      rather       responsible
 % tabnoun childhood
 You entered the 6th word in 2.595 sec(s). Good, but could be even better next time. You get 80 points.

 Ready for the next word? Type 'tabnoun <tab>' again.
 % tabnoun
 asleep     expensive  likely     rarely     secretary
 % tabnoun secretary
 You entered the last word in 3.053 sec(s). Not bad, try better next time. You get 60 points.

 Game over. Your total score for this game: 580.

 Congratulations, you made the high scores list!

 +------+-------+--------------------------+
 | Name | Score | Time                     |
 +------+-------+--------------------------+
 | u1   | 610   | Tue Sep 21 17:40:25 2021 |
 | u1   | 600   | Tue Sep 21 17:39:51 2021 |
 | u1   | 600   | Tue Sep 21 17:42:34 2021 |
 | u1   | 580   | Tue Sep 21 19:07:10 2021 |
 | u1   | 560   | Tue Sep 21 17:42:01 2021 |
 +------+-------+--------------------------+


 To play another game, press 'tabnoun <tab>' again.

A demo screencast:

DESCRIPTION

Welcome to tabnoun, 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 tabnoun tabnoun

    Or alternatively, install shcompgen from CPAN using cpanm -n App::shcompgen.

  • tcsh

     % complete tabnoun 'p/*/`tabnoun`/'

    Or alternatively, install shcompgen from CPAN using cpanm -n App::shcompgen.

  • zsh

    Put a file named _tabnoun containing the text below somewhere to your fpath:

     #compdef tabnoun
     _tabnoun() {
       si=$IFS
       compadd -- $(COMP_LINE=$BUFFER COMP_POINT=$CURSOR tabnoun)
       IFS=$si
     }
     _tabnoun "$@"

    Or alternatively, install shcompgen from CPAN using cpanm -n App::shcompgen.

  • fish

     % complete -c tabnoun -f -a '(begin; set -lx COMP_SHELL fish; set -lx COMP_LINE (commandline); set -lx COMP_POINT (commandline -C); tabnoun; end)'

The objective of the game is to select nouns 7 times as fast as possible, each from a list of 5 words. For each noun, you type "tabnoun " then press Tab (Tab) to see the list of words. You can now select the noun by typing it manually or by completing it using tab completion. After that, press Enter to clock in your time for the noun. Your points will be determined from how fast you entered the noun. Do the same for the rest of the nouns to get the total score.

OPTIONS

--help

Display help and exit.

--version

Display version and exit.

--reset-game

Reset game.

--reset-high-scores

Reset high scores.

--high-scores

Show high scores and exit.

HOMEPAGE

Please visit the project's homepage at https://metacpan.org/release/Games-TabNoun.

SOURCE

Source repository is at https://github.com/perlancar/perl-Games-TabNoun.

SEE ALSO

This game serves as a demo of the Complete module family, including Complete::Bash, Complete::Util, and so on.

Other games played by tab completion: Games::Tabnoun

AUTHOR

perlancar <perlancar@cpan.org>

CONTRIBUTING

To contribute, you can send patches by email/via RT, or send pull requests on GitHub.

Most of the time, you don't need to build the distribution yourself. You can simply modify the code, then test via:

 % prove -l

If you want to build the distribution (e.g. to try to install it locally on your system), you can install Dist::Zilla, Dist::Zilla::PluginBundle::Author::PERLANCAR, and sometimes one or two other Dist::Zilla plugin and/or Pod::Weaver::Plugin. Any additional steps required beyond that are considered a bug and can be reported to me.

COPYRIGHT AND LICENSE

This software is copyright (c) 2021 by perlancar <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.

BUGS

Please report any bugs or feature requests on the bugtracker website https://rt.cpan.org/Public/Dist/Display.html?Name=Games-TabNoun

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.