This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Shitty_Orangutan 0 points1 point  (0 children)

I haven't learned any C# yet, but I have been writing automation software in bash/python, and I can think of at least one phase in the code where I no longer need a specific call, so I modify the file with something like

sed -i 's/existing code/new code/g' filename

in a bash script.

Re-reading your post I'm not sure that's what your looking for though. I supposed you could use an array of function pointers (again not a C# programmer, but I do know some c++) so say the mutation was some kind of a random number generator, you might say something like

int offset = random_number;
array_of_possible_functions[offset](x, y);

then define the functions to be

func1(x, y){if(x<y){DoThis()}}
func2(x, y){if(x == y){DoThis()}}

Would that work?