Self modify program
Blitz3D Forums/Blitz3D Beginners Area/Self modify program
| ||
Does anyone know how to make a program wich can modify itself? |
| ||
I tryed modifying an included file, but it don't work,... |
| ||
You can't do it. Include files are compiled into your exe so modifying them will just change your source code. |
| ||
I'll not make an exe, but run by the compiler. |
| ||
Same thing. |
| ||
Is there anythings wich i can do? |
| ||
Learn assembly/machine language. But why bother? |
| ||
I've got an idea: i'll not make a program that will modify itself but a program that will modify, for example an html file. |
| ||
Another option is to use something like BVM. |
| ||
In which way? |
| ||
You CAN'T write a program in Blitz which modifys ITSELF, but you CAN write an "interpreter" in Blitz which executes a script (text file), and the script could modify the script. |
| ||
You CAN'T write a program in Blitz which modifys ITSELF Yes you can. ;) To a point, anyway. |
| ||
In wich way i can? |
| ||
I found a method which doesn't use BVM. Simply the program(source code) write itself and then, using blitzcc.exe, it compile the its source code and end itself. So, i can write a program wich modify itself. |
| ||
Sounds a bit long winded (write a program to execute the blitz compiler on a file that you are modifying - with the program - and re-run the new program)... Just use BVM or F. Tayler's BlitzScript. |
| ||
no, for my programs BVM isn't convenient... |
| ||
You won't be able to distribute them tho. |
| ||
You won't be able to distribute them tho. BINGO! |
| ||
The program i would like to create will use the technique of modifying itself to be able to learn and improve their code, like genetics and evolution. In fact they will be able to evolve! |
| ||
Splinux... How about BlitzScript? Sorry, i dont have a link right here, but i did get to play with it once, and it was bloody amazing how it worked. Should be around the forum somewhere... |
| ||
But, is possible with blitzscript exec a file only when a blitzbasic program asks? |