From the top.

I thought I would start with a little recap of my experience before I started to get more serious about learning to code.

I started with Arduino and an idea to make a robot, this did not get very far. A few blinking lights here, a speed controlled motor there and before you know it a full blown autonomous car… That keeps crashing into walls and seemingly working outside of the code.

Frustration led me to purchase a book and to start tackling Python. I won’t bore you with the example projects and tutorials that I went through, but I finally started to understand what I was actually doing.

My first major step was achieved. A GUI version of Blackjack! Albeit I did end up writing it three times. First as a hack job attempt with a massively confusing single block of code running the main game.

Screen Shot 2018-03-24 at 16.28.49

Quite confusing, pretty unreadable and plenty of bugs. I decided that maybe I should follow the design recommendations that I had learned and turned towards a more object oriented approach (basic I know, but I had only just learned about classes!).

My second approach was a lot simpler.

Screen Shot 2018-03-24 at 16.34.26

All that code condensed down into 10 lines through the use of a class and encapsulation.

Screen Shot 2018-03-24 at 16.39.58

Super fancy I know! Joking aside I was quite happy with how everything went. The game worked, counted the score and looped continuously.

And then I discovered Pygame.

My next post will be about my attempt to get Blackjack to work in Pygame, and will contain more detail about what is going on and problems I encountered ect. I just needed to start with one post as a bench mark.

Need help, or want to contact me?

jhuntington@tutanota.com

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s