Pages

Subscribe: Subscribe to me on YouTube

Saturday, October 20, 2012

Amelie went to her Grandma & Grandad's house yesterday and made cupcakes...


But if you think she's got the proudest face in this family, think again. I'm currently taking self-satisfaction to a whole new level with the kind of smug expression rarely seen since Monkhouse hung up his greasepaint. Yes, after countless hours of ceaseless hard work, I've completed the first week of my programming course. And it only took me a fortnight.

While others were enjoying the balmy mid-October flooding and gale-force conditions, I spent my lunch breaks this week holed-up in various NHS consulting rooms, wrestling with my bodily functions in an attempt to understand the serpentine constrictions of Python. Lunch on Thursday consisted of an online exam featuring questions such as this one:

Implement the function f(x) = -5 x5 + 69 x2 - 47 in Python. Compute that the function values f(0), f(1), f(2), and f(3). Enter the maximum of these four numbers.

I completed that poser in the on-call doctors' room at Uckfield Hospital. It's just down the corridor from Minor Injuries, which is handy as the test gave me slight brain damage.

Having passed both the week's quizzes, that just left me with the 'mini-project', which is best explained by this video tutorial...


The aim was to write a program that simulates five rounds of Rock, Paper, Scissors, Lizard, Spock. And I'm telling you now, there have been times this week when that's felt less achievable than winning The X Factor. I've come close not only to throwing in the towel, but to wrapping it around my neck and strangling myself. But finally, late last night, twenty-four hours before the class deadline, and with my sanity levels hitting rock (paper, scissors) bottom, I successfully completed the task.

This is possibly the most disappointing link you'll ever click on, but my program is here. You run it by pressing the top left button with the arrow. And then brace yourself for an anticlimax. It's not interactive, it's not exciting, and it doesn't look good. But every time you run it, it chooses five random guesses and decides the winner. And I programmed that myself. I'd say it's the proudest moment of my life, but I don't want to upset Lisa and the kids.

***UPDATE*** Having just watched Lisa try - and fail - to run my program, I realise I should have pointed out that it doesn't work in Internet Explorer. You need Chrome, Firefox or Safari. Otherwise it's an even bigger waste of your time.

9 comments:

Phil's Mum said...

Before reading your blog today I had a text from your aunt, asking what on earth you are on about and, having read about it, I can definitely assure her I have no idea!  But, as your mother, I am of course very proud of you!

Phil said...

Next you'll be telling me you don't watch The Big Bang Theory.

Phil's Mum said...

Of course not.  I'm too busy reading, and trying to understand, your blog.

Zed said...

Well, it's taking a while to load, but we do have very slow internet in Norfolk.  I appreciate programming it to work in Safari, we Mac users are often left out.

Ro took a computer course some 8 years ago - a freebie after doing some voluntary work at university.  Now, he is a Senior Interface Developer, whatever that means.  It draws you in, programming.

A Passer-By said...

Well, Phil, once you've sorted your snake handling skills, you can ask for a pay rise based on what you're worth in the open market - see  http://www.theitjobboard.co.uk/IT-Job/Senior-UI-Solutions-Developer-Python-Cambridge-35-40k/8705236/en/?xc=389&utm_source=Feed&utm_medium=Aggregator&utm_campaign=Adzuna

A passing web geek said...

Ah yes, welcome to web development and freakin' Internet Explorer...

http://www.youtube.com/watch?v=JyGP0ZyxF5E

Phil said...

Ha! Brilliant!

BS6 said...

Hello.   its a while since ive seen a real programming language. too much "draw box on screen" object stuff for me usually. Interested the random runs from 0 to 5, but gonna give this a try... as no doubt the live traffic feed thing on the right is about to tell you. Thats spooky that thing, I get paranoid just watching it and wondering who these people are :)

Phil said...

I think most of them are lost.

For reasons which are beyond me, the range is inclusive of the first number you specify, and exclusive of the second. So if you use 0 to 4, it will never choose scissors. Change it and see. Go on, I dare you.