Jump to content




bfluac -- Convert bf programs to lua.


2 replies to this topic

#1 Admicos

  • Members
  • 207 posts
  • LocationTurkey

Posted 18 July 2016 - 09:26 PM

bfluac -- convert bf to lua

HOW TO USE

bfluac.lua <file containing bf code> [extra arguments]
This will save the lua code to <filename>.bf.lua


ARGUMENTS

-memLimit <number> allows you the set maximum value of a memory block (default 28-1)
-memBlocks <number> allows you the set how many memory blocks will be available for the program. Too low might cause crashes (default: 17)
-dbgSleep <number> how many seconds should the program wait before executing the next instruction (debug only) (default: 0.005)
+dbg enables debug mode for the program


DOWNLOADS

9ymddf3E (pastebin) or admicos/bfluac (packman): bfluac

b1m5khc0 (pastebin) or admicos/bfluac-helloworld (packman): hello world converted in bfluac (debug mode on and dbgSleep = 0.001)


Also, the forum's WYSIWYG Editor might need some tweaking too

Edited by Admicos, 22 July 2016 - 06:37 PM.


#2 bauen1

  • Members
  • 102 posts
  • LocationIn your Computer

Posted 19 July 2016 - 01:46 PM

Looks nice so far, there are some bugs tho:
It doesn't like programs with ]] or [[ or if they end with ]
Also there is loots of room for improvements (Check out the modulo % operator for wrapping)
And you could use "or 0" when accessing the tape so you don't need to preinitialize the tape

Oh and you have a very nice debug function :)

#3 Admicos

  • Members
  • 207 posts
  • LocationTurkey

Posted 19 July 2016 - 02:25 PM

 bauen1, on 19 July 2016 - 01:46 PM, said:

Looks nice so far, there are some bugs tho:
It doesn't like programs with ]] or [[ or if they end with ]
Also there is loots of room for improvements (Check out the modulo % operator for wrapping)
And you could use "or 0" when accessing the tape so you don't need to preinitialize the tape

Oh and you have a very nice debug function :)
The ]] bug is fixed on the latest version, but it's not on pastebin. I just put it up (9ymddf3E)
I intentionally preinitialized the memory, but i might add a argument making it dynamic (dunno how it'll look on debug tho)





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users