The UNIX Pipe Card Game
pipes
cat, grep, tail, head, wc, sort, uniq
Buy now: €5,00 EUR
task: print the most common line from a file, we need to first cat the file (in our case the file is card 03.txt), then sort it, uniq count it, then do numeric sort, then tail -1:
cat 03.txt | sort | uniq -c | sort -n | tail -1
RULES: > 0. The youngest player chooses one of two formats for the game: * Whoever has the smallest pipe chain to complete the task wins the round. * Whoever has the largest pipe chain to complete the task wins the round. > 1. The youngest player picks a task from the tasks card. You can not pick the same task twice. > 2. Shuffle the cards. > 3. Put the cards face down on the table. > 4. Going clockwise each player picks the top card from the deck and tries to complete the task. > 5. The first player who completes the task gets a point. > 6. IF there are no more tasks, GOTO 8 > 7. GOTO 1. > 8. GAME OVER. INSERT COIN. GOTO 8 TASKS * print the second line * print the second to last line * print the 7th line * print the most common line * print the least common line * count how many lines have "rises" * print the first line that has W in it * count the lines that have "in" in them * show two random lines * count the words on the last two lines * print the 7th and 8th line * count the lines with ! * count the lines without ! * make a command chain that does not print anything
Programming Time, which is a game to teach python and some more fundamental algorithms, from hash tables to RSA
The C Pointer Game - Pointers, Arrays and Strings, a game to teach kids to look at the computer memory and understand references and values
... continue reading