Learning Python – Snake
This is actually an old article that I never got round to posting and I’m already halfway through my next game, oh well, here it is anyway
—
I guess logically the first game to make in Python is Snake.
Simple games are generally separated into 3 main sections (or at least mine are): constants that have values for the fps, screen size and other settings; functions that define logic & behaviours of elements within the game; and the main program loop which runs each frame and orders the logic and drawing.
No commentsLearning Python – A first foray into games & graphics
I have started close to 50 game projects in the last few years, many reached only planning stages but a few resulted in something somewhat playable. I’ve used a couple of technologies, text & canvas web games and DarkBasic, however neither really felt ideal to me.
Programming a game in canvas requires too many different languages: Javascript, PHP, HTML & MySQL if you want any persistance; while the syntax of DarkBasic is not to my liking and as a language it has some very frustrating structural limitations.
No commentsLearning Python – Proving the Birthday Paradox
There is a fantastic book that deals with the history, philosophy and genius of maths called Alex’s Adventures in Numberland by Alex Bellos. I’ve just finished reading the chapter on probability in which he discusses the birthday paradox.
This is the idea that in a group of 23 people there is just over a 50% chance of having 2 people who share the same birthday. At first glance this doesn’t seem true, but through a series of logic and probability proofs Bellos shows this is indeed the case.
No comments