izmeina: a snippet of Escher's circle of serpents (escher)
izmeina ([personal profile] izmeina) wrote2014-10-20 12:05 am

A Perplexed Python

A certain Cyberian serpent has been gobbling up all my spare online time and more besides. Python is a hard task master and demands sacrificial offerings every week since early October. So I’m woefully behind in catching up with comments and gossip in general. Even the RasPutin vs The Mad Monk mixed martial arts championship has been sadly neglected. Some of the cartoonists have been having a wonderful time devoting their poisoned pens to portraying the assorted training regimes of the two combatants.

Two moronic macho males flex their muscles


I must be going completely crazy. It’s simply not normal to be slaving over a keyboard at 6.30 in the morning in a desperate attempt to put some last minute touches on a very buggy game of Pong. I might manage to salvage 12 of the 19 possible points which is a bit of an improvement on the first version that would be struggling to score more than 6.
So it looks like I have well and truly hit the wall this week. Will keep plodding along anyway since this python is proud of her persistence. Here’s hoping the long hoped for light bulb moments are not too far away. November will be the true test of commitment since the annual ritual of novel writing is simply not negotiable.

It is simply not rational to expend such time and effort on a course that has very little use in real life. It could come in handy for two grand procrastination projects - a second attempt at Coursera’s cryptography classes and a rather long to do list at Project Euler. I guess they are the online equivalents of designing that deck of tarot cards, actually editing at least one of 5 nano novels and finishing sewing and stuffing Snowball the teddy bear.

And this week’s topic in the very interesting “Learning how to learn” course is all about procrastination and zombies. Perfect timing.
catness: (keep_flying)

[personal profile] catness 2014-10-20 10:19 am (UTC)(link)
I can assure you it's totally normal, in reference to programming/hacking norms ;) Frankly, I'm envious, that's the kind of enthusiasm I wish to regain... Good luck! *Googlety-googling Project Eiler* wow, you're doing that? amazing! You might enjoy the subsequent parts of the Python course then, which are heavier on math.

Mwahaha, THAT's how the conflicts between countries should be resolved... the leaders should fight face-to-face, not sending a bunch of cannon fodder to do their dirty job...
catness: (catblueeyes)

[personal profile] catness 2014-10-25 04:21 pm (UTC)(link)
What do you mean by the boolean list representing their positions? As they're drawn in a row, you don't need to store their positions on the canvas, you just draw them one by one - the Y-coordinate is the same, and the X-coordinate depends on the number of the card (not number ON the card). And the list of their states, i.e. exposed or not, is just an additional list, indexed by the number of the card. (You don't have to shuffle it together with shuffling the cards list, because none of them are exposed anyway in the beginning.)

Looking forward to hearing more about the evil Nano ideas ;)
catness: (catfishbowl)

[personal profile] catness 2014-10-25 04:58 pm (UTC)(link)
So "deck" is your list of 16 cards, and you have another list of their properties: "exposed", which is also a list of 16 elements. You might find it easier to use a loop by the number (index) of the card, e.g.

for num in range [0, 16):

# check the property of the card number 'num' i.e. exposed[num]
# do something with the card number 'num' i.e. deck[num]


And when you click on a random card, you can calculate its index from the mouse coordinates, seeing that you know the cards width and the initial positions, so you can update its property in the "exposed" list.
catness: (alleycat)

[personal profile] catness 2014-10-26 08:17 am (UTC)(link)
Bummer, I thought the explanation about indexes was adequate... Here's the corrected version with a lot of comments, I hope it's clear now? As the master of Maps vs Territory, you have to understand the difference between the indexes and contents very well ;)

http://www.codeskulptor.org/#user38_OiCqu46km465Xy6.py

(you still have to work on presentation, i.e. borders between cards, but it's a minor thing)