Page 1 of 1

Code to generate code

Posted: Mon Jan 09, 2012 12:55 am
by BB+
This is more at the level of a joke (suggested by my officemate), but does this count as typing my own code to "generate" code?

Code: Select all

cp Fruit-2.1/src/* Marks-New-Engine/src
I have now generated my "own" engine code, via an accepted tool (cp) for "code generation" (snicker). I will then modify it, to a greater or lesser extent.

Re: Code to generate code

Posted: Wed Jan 11, 2012 7:14 am
by kingliveson
You forgot a couple important steps; rename the engine and add your name as the author.

Code: Select all

#!/bin/sh
sed 's/Fruit 2.1/Celka 1.0b/;  s/Fabien Letouzey/Yusik Rajpov/' ./fruit_21/src/main.cpp > main.cpp
sed 's/Fruit/Celka/;  s/Fabien Letouzey/Yusik Rajpov/' ./fruit_21/src/protocol.cpp > protocol.cpp
sed 's/fruit/celka/' ./fruit_21/src/Makefile > Makefile
mv main.cpp ./fruit_21/src/
mv protocol.cpp ./fruit_21/src/
mv Makefile ./fruit_21/src/
mkdir Celka && cp ./fruit_21/src/* Celka
cd Celka
make
exit 0