Python code to solve xkcd 1313 by Peter Norvig
nbviewer.ipython.org
Python code to solve xkcd 1313 by Peter Norvig
1–10 of 75 posts
Re: Python code to solve xkcd 1313 by Peter Norvig
#2This was posted a few days ago on Code Golf:
http://codegolf.stackexchange.com/questions/17718/meta-regex...
That link includes a perl 10-liner to do the same.
Re: Python code to solve xkcd 1313 by Peter Norvig
#3I love Norvig's Python posts. He really gets the spirit of the language and has fun with it.
Re: Python code to solve xkcd 1313 by Peter Norvig
#4[deleted]
Re: Python code to solve xkcd 1313 by Peter Norvig
#5I thought it was going to be meta-meta-regex golf, and couldn't imagine how that would be possible. But meta-regex golf is an interesting exercise, and is far more tractable. :)
Re: Python code to solve xkcd 1313 by Peter Norvig
#6I don't know why Randall's regex incorrectly (?) matches "Fremont", but it's worth noting Wikipedia's primary spelling has an accent aigu "Frémont":
Re: Python code to solve xkcd 1313 by Peter Norvig
#7This was posted a few days ago on Code Golf: http://codegolf.stackexchange.com/questions/17718/meta-regex... That link includes a perl 10-liner to do the same.
Since that XKCD was from today, pretty sure the question is from today too :)
Re: Python code to solve xkcd 1313 by Peter Norvig
#8I don't know why Randall's regex incorrectly (?) matches "Fremont", but it's worth noting Wikipedia's primary spelling has an accent aigu "Frémont": https://en.wikipedia.org/wiki/John_C._Frémont
Frémont still matches "[rn]t", so the problem persists regardless of this spelling.
Re: Python code to solve xkcd 1313 by Peter Norvig
#9I am not sure why Norvig omits president Obama. That said, "[mtg]a" does match him, so at least Munroe tries.
Re: Python code to solve xkcd 1313 by Peter Norvig
#10I am not sure why Norvig omits president Obama. That said, "[mtg]a" does match him, so at least Munroe tries.
His source page doesn't list Obama, for whatever reason.