Jump to content
  • Advertisement
Sign in to follow this  
  • entries
  • comments
  • views

BF Macros

Sign in to follow this  


This is not a "new" EPL.
This is not an EPL "enhancement".
This is a tool to assist in the writing of BF by raising the level of abstraction.
And if you think of this as "cheating": unless you program solely in machine code, you can STFU.

I've got an idea of what the macro language should look like (it is rather C/C++-ish):

#define ZERO(x) >(x)[-]<(x)
#define POSITION 10



expands to:


which expands to:


which expands to:


a negative value is represented with a leading '~' instead of '-', because '-' is already a BF instruction.

>(~x) becomes <(x)
<(~x) becomes >(x)
+(~x) becomes -(x)
-(~x) becomes +(x)
.(~x) becomes ,(x)
,(~x) becomes .(x)
[(~x) becomes ](x)
](~x) becomes [(x)

in the end, everything still winds up as BF code, suitable for any BF interpreter.

Of course, I'm doing the thing backwards, so step one becomes:

turn this:




Sign in to follow this  


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!