Entry tags:
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.

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.

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.
no subject
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...
no subject
There's a reason I called it a 'rather long To Do list' and that's because it's not getting done.
Some one in the mathematical thinking class had mentioned Project Euler. Took a peek and it looked like a tempting puzzle palace with zillions of rooms. Also randomly clicked on some of the solutions to see that Python was a very popular tool used to solve them.
It just goes to show the power of an external deadline. Had to dump this Python class back in September 2012 due to dramas with a certain old toad. But that was not before downloading all the videos.
But do you think that this serpent looked at a single one of them in all that time before this class started? Not once?
So it would be crazy not to make the most of the new set of external deadlines this time around. The Memory miniproject is due at midday tomorrow but I will not be slaving over a hot keyboard at 6 in the morning this time or staying up until 2am like last night. I've well and truly slammed into the brick wall on this project. Simply cannot think of a way to link the list of shuffled cards with the Boolean list representing their positions. Without that connection, the rest of the steps are at a dead end.
Will be going to a nano plot storming session with a bunch of folks tomorrow and need the little green cells to be in full working order.
Will keep you posted on the boxing match. I suspect our mad monk is going to chicken out.
no subject
Looking forward to hearing more about the evil Nano ideas ;)
no subject
So not sure how this copies in this comment bar but here's the contents of the draw handler
def draw(canvas):
# draw lines on canvas
card_pos[0] = 0
for card in deck:
canvas.draw_line([card_pos[0], 0],[card_pos[0], HEIGHT], 2, "White")
card_pos[0] += 50
# Make unexposed cards green
# card_pos[0] = 25
# for card in deck:
# canvas.draw_line([card_pos[0], 0],[card_pos[0], HEIGHT], 50, "Green")
# card_pos[0] += 50
card_pos[0] = 20
card_pos[1] = 60
for d in deck:
canvas.draw_text(str(d), card_pos, 40, "Green")
card_pos[0] += 50
Every attempt at bringing in the logic of
if exposed = false - make card green or
if exposed is true - draw number from deck
results in a total disaster. So figured the best thing to do is to forget about the green and just leave the numbers exposed. At least that way I can prove I could produce them and shuffle them and that they get reshuffled whenever the reset button is clicked.
no subject
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.
no subject
Did end up farting around a bit with it until the ridiculous hour of 2 in the morning with absolutely nothing to show for it
All the experiments resulted in either all the numbers showing or none at all. Nothing in between at all.
I spent lots of time concentrating on iteration and such and rather neglected the dark art of indices which turned out to be central to this whole drama.
Still quite stuck on the whole naming and calling of variables thing. I get the whole thing with the distinction between the contents/ values and the index/ position of a particular card but quite clueless about the subtle differences between the different calls.
Lots of folks were getting totally mixed up with the containers and their contents and there were a few good suggestions that future versions of the game should involve matching letters of the alphabet in order to keep the two concepts clearly separated.
So in the end none of the experiments made it into the very basic submitted version
http://www.codeskulptor.org/#user38_A9SsT65Pio_0.py
Some of the assorted experiments got left in this graveyard version with the strange green zombie lurking at the end of the line
http://www.codeskulptor.org/#user38_njmcLhcOLO_20.py
They are warning us already that Blackjack is the big bad project. I can just see an evil Izzie devouring cannibal python making an appearance in November's novel
no subject
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)
no subject
Presently using rhe crappy tablet keyboard so no proper reply until some time later tomorrow
So far everything is explained in a manner that even newbies can understand. Maybe there is still hope for this frazzled zombie serpent ;)