Code to generate code

Whatever else you want to talk about. Forum rules still apply.
Post Reply
BB+
Posts: 1484
Joined: Thu Jun 10, 2010 4:26 am

Code to generate code

Post by BB+ » Mon Jan 09, 2012 12:55 am

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.

User avatar
kingliveson
Posts: 1388
Joined: Thu Jun 10, 2010 1:22 am
Real Name: Franklin Titus
Location: 28°32'1"N 81°22'33"W

Re: Code to generate code

Post by kingliveson » Wed Jan 11, 2012 7:14 am

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
PAWN : Knight >> Bishop >> Rook >>Queen

Post Reply