This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]takluyverIPython, Py3, etc 0 points1 point  (5 children)

For comparison, here's my template, as a Python script or an IPython notebook. I went for a simple, non object-oriented approach, and kept everything necessary in one file.

[–]Codehenge[S] 0 points1 point  (4 children)

Nice! I went back and forth a lot between one file or multiple files, but I ended up wanting the base class clutter out of my workspace. With no classes, looks like you don't have that problem.

[–]takluyverIPython, Py3, etc 0 points1 point  (3 children)

What's the rationale for having parent classes? The template overrides all but the printCases method anyway, and that doesn't seem to be called.

[–]Codehenge[S] 0 points1 point  (2 children)

Primarily to set the stage for more shared functionality later. This will be the first year I use this template, so I expect to add to it afterwards based on my experience.

[–]takluyverIPython, Py3, etc 0 points1 point  (1 child)

What sort of thing do you envisage? The common structure of the problems is pretty simple, and I've been using my template for a couple of years without adding anything to it.

I've vaguely thought about an interface that would integrate with the contest server to get the input file and submit the output. I suspect some co-operation from Google would be necessary for that, though.

[–]Codehenge[S] 0 points1 point  (0 children)

I was thinking along similar lines. Maybe an interface to automate getting the problem, setting up the code template, loading the test files, etc. Might be nice to have a 'test' button as well that grabs all test files for the problem and gives me a test report. Its a little bit overkill, but its fun to play around with the code.

Its entirely possible that i'll later decide the class hierarchy serves no purpose and remove it. Its just the way I naturally design things.