X-Git-Url: http://git.ieval.ro/?a=blobdiff_plain;f=nethackify.dir%2Fnethackify.c;fp=nethackify.dir%2Fnethackify.c;h=0000000000000000000000000000000000000000;hb=846aed59c5121e74a5d8c7b9c0421487933d1536;hp=1f6cb6c44296920c96acb985a1c675e75f19e897;hpb=c0322e3d82021b378295712bea5f8753c4d17b05;p=filters.git diff --git a/nethackify.dir/nethackify.c b/nethackify.dir/nethackify.c deleted file mode 100644 index 1f6cb6c..0000000 --- a/nethackify.dir/nethackify.c +++ /dev/null @@ -1,87 +0,0 @@ - -/* -nethackify -tries to write text ala nethack - -cat /etc/motd/ | nethackify -/exec -o nethackify "good morning :)" - -gurkan@linuks.mine.nu -*/ - -#include -#include -#include -#include - -char *normal ="ABCDEFGHIKLMNOPQRTUVWZbdeghjklmnoqwy:;01678"; -char *nethack1="^P(|||C||||||CFCP|J/V/|cccni||nrccvv.,C|o/3"; -char *nethack2="?b?)F-(-?<_??(?(F???/??|??????r???????(???o"; -char *nethack3=" [ [L \\ "; -char *nethack4=" [ \\ "; -char *nethack5=" _ \\ "; - -int myrandom(float max) -{ - return ((int)(max*rand()/(RAND_MAX+1.0))); -} - -void nethackify(char* str) -{ - int i,c; - for(i=0; i0) { - switch(myrandom(5)) { - case 4: if(nethack5[c]!=' ') str[i]=nethack5[c]; - case 3: if(nethack4[c]!=' ') str[i]=nethack4[c]; - case 2: if(nethack3[c]!=' ') str[i]=nethack3[c]; break; - case 1: if(nethack2[c]!=' ') str[i]=nethack2[c]; break; - case 0: str[i]=nethack1[c]; break; - default: break; - } - } - } - } - printf("%c",str[i]); - } - - printf(" "); -} - -int main(int argc, char **argv) -{ - int i,c; - struct timeval tv; - FILE *f; - char ch[1]; - - srand((gettimeofday(&tv,NULL),tv.tv_usec)); - if (argc==1) { - f=stdin; - while(fread(ch,1,1,f)) { - for(c=0; c