Add 2019/endoh/try.sh, helper program + formatting
The helper program ascii.c converts args passed to it to char values (if isascii() returns non-zero) which with try.sh allows one to reconstruct the code with the backtrace rather than having to memorise ascii(7) (and even if they did it would be hard to put it together). One should of course use xargs(1) and try.sh does. The try.sh script checks that gdb is installed first, telling the user to install it if they don't have it. The README.md file notes that for macOS It's not a simple matter of just installing gdb - there are additional steps.
This commit is contained in:
1 parent
88e8d6a83d
commit
40936af68e
6 files changed
+88
-1
No files matched your search
@@ -0,0 +1,19 @@
|
||||
/*
|
||||
* ascii.c - simple program that shows the character value of ASCII values, if
|
||||
* isascii() is true, to help demonstrate IOCCC winner 2019/endoh.
|
||||
*
|
||||
* Will not do anything if no args specified. Use xargs(1) to pass args to
|
||||
* program if it's a lot of characters.
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
#include <stdlib.h>
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
int i;
|
||||
for (argc = 1; argv[argc]; ++argc)
|
||||
{
|
||||
i=atoi(argc[argv]);
|
||||
if (isascii(i)) printf("%c", i);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user