• entries
292
557
• views
154113

# BF Macro Step One Solution

86 views

Thinking a bit since my earlier entry...

since the macro handler is much like the C/C++ handler, I thought I might as well just use a C preprocessor, and see where it lead me.

I wound up using the Cybiko preprocessor.

Now I've got a tool that takes the following:

#define SET(x,y) >(x)[-]+(y)<(x)#define ZERO(x) SET(x,0)#define POSITIONA 10#define POSITIONB 12#define VALUE ~5ZERO(POSITIONA)SET(POSITIONB,VALUE)

and converts it to the following:

>(10)[-]+(0)<(10)>(12)[-]+(~5)<(12)

So, most of the hard part is done... all I need now is to make a tool to take it the rest of the way, and I'm done!

There are no comments to display.

## Create an account

Register a new account