in the name of zero

November 22, 2005

my head actually hurts!

Filed under: hermetic studies

ascii codes are mandatory in bf programing, so to guide me in making my first program i coded a helper function in c like so:

ascii.c
/** char to ascii code converter
 * brainf*ck helper program i wrote for fun.
 */
#include
#include
	
void t(char *stepy) {
        while (*stepy) {
                printf("%c : %d\n",*stepy, *stepy);
                stepy++;
        }
}
	
int main()
{
        char *stepy;
	
        stepy = strdup("I Love You Steph!\n");
        t(stepy);
	
        free(stepy);
        return 0;
}

when compiled and run, ascii.c will print out the string and its ascii code, character by character.

ok so the easy part is done. i now had to convert those encodings to something that bf can understand. the finished product? here it is. took me roughly 10 minutes to complete this!

steph.bf
++++++++++[>+++++++<-]>+++.>+++[>++++++++++<-]>++.
>++++++++++++[>++++++>+++++++++>+++++++++>++++++++<<<<-]
>++++.>+++.>++++++++++.>+++++.>+++[>++++++++++<-]>++.
>++++++++++[>+++++++++>+++++++++++>++++++++++++<<<-]>-.
>+.>---.>+++[>++++++++++<-]>++.>++++++++++[>++++++++
>++++++++++++>++++++++++>+++++++++++>++++++++++
>+++<<<<<<-]>+++.>----.>+.>++.>++++.>+++.>++++++++++.

time waster for sure. but i had a good time. oh well, goodnight and sweet dreams.

Comments »

The URI to TrackBack this entry is: http://gnurbs.blogsome.com/2005/11/22/my-head-actually-hurts/trackback/

No comments yet.

RSS feed for comments on this post.

Leave a comment

Line and paragraph breaks automatic, e-mail address never displayed, HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>


Get free blog up and running in minutes with Blogsome | Theme designs available here