New answers tagged

5

I've given up and tried to bruteforce it - with little regards to what could happen to my machine. I'm importing every builtin module and evaluating the input on every function they've got. As I don't know a list of builtins, I'm using the help("modules") one, the pkgutil.iter_modules() one, and the sys.builtin_module_names one. import pkgutil ...


2

Here's a score of 24 I'm pretty sure this is optimal, because


4

Here's one possibility: Demonstration: No spoilers in code below. def grid(num): secret = eval(secret_str) print('\n'.join(secret)) grid(1) # ----- # | O | # ----- grid(2) # --------- # | O | O | # --------- # | O | O | # --------- grid(3) # ------------- # | O | O | O | # ------------- # | O | O | O | # ------------- # | O | O | O | # ------------...


5

49 bytes, respecting the spaces on the right side: That said, it isn't a very interesting puzzle since string formatting tasks are common in regular programming, except the bit of inferring what the magic should evaluate to. I hope you come up with more interesting ones later :)


4

From a fellow abuser of listcomps, magic is The hint is


5

I believe the first pattern is (with (0,0) at top left) And the last is (with (0,0) at top left) where The question has been updated to include a request to "explain your answer". I don't have much explanation to offer for the first pattern. I just I can say a little more about the fourth.


4

(2 out of 4) $(0,0)$ is bottom left, not top left. 2nd pattern: 3rd pattern:


6

Solution: Explanation:


6

If I'm reading the puzzle correctly, easiest answer would be Explanation:


Top 50 recent answers are included