##Generating all possible functions/programs to solve a challenge
Generating all possible functions/programs to solve a challenge
In this meta post, isaacgizzyg pointed out that, under current consensus, the following Python code (edited to fix a mistake) could possibly be viewed as valid:
for i, code in enumerate(all_possible_strings):
try: exec("func" + str(i) + "=" + code)
except: pass
Given enough time, the desired function will eventually be generated and assigned to func<some large number>, which could then be called with the desired arguments and would return the desired result.
Though we do not forbid brute-forcing, solutions of this sort are clearly exploitative in the same vein as MetaGolfScript, and we certainly do not want this solution on every challenge where functions are allowed.
##Generating all possible functions/programs to solve a challenge
In this meta post, isaacg pointed out that, under current consensus, the following Python code (edited to fix a mistake) could possibly be viewed as valid:
for i, code in enumerate(all_possible_strings):
try: exec("func" + str(i) + "=" + code)
except: pass
Given enough time, the desired function will eventually be generated and assigned to func<some large number>, which could then be called with the desired arguments and would return the desired result.
Though we do not forbid brute-forcing, solutions of this sort are clearly exploitative in the same vein as MetaGolfScript, and we certainly do not want this solution on every challenge where functions are allowed.
Generating all possible functions/programs to solve a challenge
In this meta post, izzyg pointed out that, under current consensus, the following Python code (edited to fix a mistake) could possibly be viewed as valid:
for i, code in enumerate(all_possible_strings):
try: exec("func" + str(i) + "=" + code)
except: pass
Given enough time, the desired function will eventually be generated and assigned to func<some large number>, which could then be called with the desired arguments and would return the desired result.
Though we do not forbid brute-forcing, solutions of this sort are clearly exploitative in the same vein as MetaGolfScript, and we certainly do not want this solution on every challenge where functions are allowed.