NetHack death statistics
This script was originally posted to rec.games.roguelike.nethack by Faux_Pseudo.
grep killed /usr/games/lib/nethackdir/logfile | awk -F killed '{print"killed"$NF}' | sort | uniq -c | sort -r
DZone Snippets > Minimiscience > games
12364 users tagging and storing useful source code snippets
Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
grep killed /usr/games/lib/nethackdir/logfile | awk -F killed '{print"killed"$NF}' | sort | uniq -c | sort -r
#!/usr/bin/perl -wl use strict; $_ = shift or die 'Invalid argument passed'; s/\s+//g; /^(\d+)[dD](\d+)([+-]\d+)?$/ or die 'Invalid argument passed'; my $sum = 0; $sum += 1 + int rand $2 for 1..$1; $sum += $3 if defined $3; print $sum;