Drop char count of 1991/fine to 85 (was 80 -> 106)
With clever use of the Makefile and removing a cast that is not strictly
necessary (it does trigger a warning but it still produces correct
output) I was able to get what was once 80 characters but when fixed
increased to 106 characters all the way back down to 85. As for how this
was done it might be helpful to look at what it was prior to this update
as well as the original. The previous version was:
int main(int a, char **b){while((a=getchar())+1)putchar((b=64^a&223)&&(int)b<27?a&96|((int)b+12)%26+1:a);
and the original was:
main(a,b){while((a=getchar())+1)putchar((b=64^a&223)&&b<27?a&96|(b+12)%26+1:a);}
The problem with the original besides needing one of the casts is that
clang is stricter with the types of args of main(). Now it looks like:
main(a,b){while((a=getchar())+1)putchar((b=64^a&223)&&b<27?a&96|((int)b+12)%26+1:a);}
which is almost the same as the original. But how was this done? The
Makefile does:
-D'main(a,b)'='int main(a,b)char**b;'
which lets the main() part be the same as the original but still compile
with clang.
I also added the script demo.sh which simplifies running the command I
had added (or more likely extended) but it also shows it line by line so
you can see how the text is rotated. One of my favourites of the lot is
from Brian Westley and that is one I added.
This commit is contained in:
1 parent
9a15511635
commit
2b9a4ec6dd
5 files changed
+45
-14
No files matched your search
+1
-1
@@ -1 +1 @@
|
||||
int main(int a, char **b){while((a=getchar())+1)putchar((b=64^a&223)&&(int)b<27?a&96|((int)b+12)%26+1:a);}
|
||||
main(a,b){while((a=getchar())+1)putchar((b=64^a&223)&&b<27?a&96|((int)b+12)%26+1:a);}
|
||||
Reference in new issue
Block a user