tictactoe script - commented - may have pedagogical value

Chris Angelico rosuav at gmail.com
Thu Sep 7 04:05:18 EDT 2017


On Thu, Sep 7, 2017 at 5:11 PM, Steven D'Aprano
<steve+comp.lang.python at pearwood.info> wrote:
> Thank you for the explanation Stefan, but I do know how to use a browser.
>
> What I didn't know is how the HTML works. I thought it was actually doing
> some computation, but it seems like its just jumping to pre-rendered tic-
> tac-toe grids.

That's all HTML is capable of. Without assistance, HTML is nothing
more than layouts.

>
> I don't know why it places *two* pairs of crosses and naughts instead of
> one. Maybe the page is broken.

I think it is, as part of being on the Internet Archive. To get a
working version of the game, you may need to download it locally and
clean it up a bit.

> But anyway... it doesn't seem to me that the page is doing any
> computation using HTML. It's more like a book listing a table of primes.
> The book hasn't done any computation, and we wouldn't say that this is
> proof that pieces of paper are capable of programming.

Correct; however, with something this small, the difference isn't
significant. What, ultimately, is the difference between a
live-rendered image and a static photo? For the ability to brag that a
fully-playable game requires nothing more than HTML, I think this
minor cheat is worth it. It's gimmicky and cute, rather than being any
sort of "hey look, HTML is a programming language" thing.

ChrisA



More information about the Python-list mailing list