Quantcast
Viewing latest article 26
Browse Latest Browse All 57

Answer by user45941 for Loopholes that are forbidden by default

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.


Viewing latest article 26
Browse Latest Browse All 57

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>