]> iEval git - filters.git/commitdiff
Don't give special treatement to nethackify either
authorMarius Gavrilescu <marius@ieval.ro>
Sat, 18 Jul 2015 08:30:29 +0000 (11:30 +0300)
committerJoey Hess <joeyh@joeyh.name>
Thu, 30 Jul 2015 16:23:09 +0000 (12:23 -0400)
Makefile
nethackify.c [new file with mode: 0644]
nethackify.dir/makefile [deleted file]
nethackify.dir/nethackify.c [deleted file]
nethackify.dir/readme [deleted file]

index a59b5ab2cd1d88574dd7530dc7bcec60952fd96d..13d54a4e13ab5324ec3e1929c77f3c48161a06b3 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -34,7 +34,6 @@ samples:      $(BUILD) $(OTHER)
 clean:
        $(RM) -f core *.o *~ $(BUILD) SAMPLES
        cd ky00te.dir && make clean
-       cd nethackify.dir && make clean
 
 .SUFFIXES: .l
 
@@ -52,7 +51,5 @@ clean:
 ky00te:
        cd ky00te.dir && make
 
-nethackify:
-       cd nethackify.dir && make
-
+nethackify: nethackify.c
 scramble: scramble.c
diff --git a/nethackify.c b/nethackify.c
new file mode 100644 (file)
index 0000000..1f6cb6c
--- /dev/null
@@ -0,0 +1,87 @@
+
+/*
+nethackify
+tries to write text ala nethack
+
+cat /etc/motd/ | nethackify
+/exec -o nethackify "good morning :)"
+
+gurkan@linuks.mine.nu
+*/
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <sys/time.h>
+
+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; i<strlen(str); i++) {
+       for(c=0; c<strlen(normal); c++) {
+           if(normal[c]==str[i]) {
+               if (myrandom(3)>0) {
+               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<strlen(normal); c++) {
+               if(normal[c]==ch[0]) {
+                   switch(myrandom(5)) {
+                       case 4: if(nethack5[c]!=' ') ch[0]=nethack5[c];
+                       case 3: if(nethack4[c]!=' ') ch[0]=nethack4[c];
+                       case 2: if(nethack3[c]!=' ') ch[0]=nethack3[c]; break;
+                       case 1: if(nethack2[c]!=' ') ch[0]=nethack2[c]; break;
+                       case 0: ch[0]=nethack1[c]; break;
+                       default: break;
+                   }
+               }
+           }
+           printf("%c",ch[0]);
+       }
+       fclose(f);
+    } else {
+       for(i=1; i<argc; i++) {
+           nethackify(argv[i]);
+       }
+       printf("\n");
+    }
+    
+    return 0;
+}
diff --git a/nethackify.dir/makefile b/nethackify.dir/makefile
deleted file mode 100644 (file)
index 8c2fd9e..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-../nethackify:
-       gcc nethackify.c -o ../nethackify
-
-test:
-       @../nethackify The kitten bites.--More--
-       @../nethackify You begin praying to Odin.  You finish your prayer.--More--
-       @../nethackify A black glow surrounds you.
-
-clean:
-       rm -f ../nethackify
-
-install:
-       cp ../nethackify /usr/bin
-       
-uninstall:
-       rm /usr/bin/nethackify
diff --git a/nethackify.dir/nethackify.c b/nethackify.dir/nethackify.c
deleted file mode 100644 (file)
index 1f6cb6c..0000000
+++ /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 <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <sys/time.h>
-
-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; i<strlen(str); i++) {
-       for(c=0; c<strlen(normal); c++) {
-           if(normal[c]==str[i]) {
-               if (myrandom(3)>0) {
-               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<strlen(normal); c++) {
-               if(normal[c]==ch[0]) {
-                   switch(myrandom(5)) {
-                       case 4: if(nethack5[c]!=' ') ch[0]=nethack5[c];
-                       case 3: if(nethack4[c]!=' ') ch[0]=nethack4[c];
-                       case 2: if(nethack3[c]!=' ') ch[0]=nethack3[c]; break;
-                       case 1: if(nethack2[c]!=' ') ch[0]=nethack2[c]; break;
-                       case 0: ch[0]=nethack1[c]; break;
-                       default: break;
-                   }
-               }
-           }
-           printf("%c",ch[0]);
-       }
-       fclose(f);
-    } else {
-       for(i=1; i<argc; i++) {
-           nethackify(argv[i]);
-       }
-       printf("\n");
-    }
-    
-    return 0;
-}
diff --git a/nethackify.dir/readme b/nethackify.dir/readme
deleted file mode 100644 (file)
index 470d3da..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-
-nethackify
-tries to write text ala nethack
-
-cat /etc/motd/ | nhprint
-/exec -o nhprint "good morning :)"
-
-released under the gpl
-copyright 2004 by Gürkan Sengün <gurkan@linuks.mine.nu>
This page took 0.033877 seconds and 4 git commands to generate.