Snake Game in Python

This is a small snake game that i created just for fun. The source code is 4 kb in size and the snake game is very simple. You just try to eat the food while preventing the obstacles. There are a few “cheat codes”. The cheat codes and their uses are

longlongsnake : doubles the snake length
getmorescore : increases the score by 99999
doublemyscore : doubles the user score
noobstacles : removes all the obstacles

Snake Game Screenshot
Snake Game Screenshot

This is one of my first python project so don’t expect anything fancy.

The source code is as given below.

php file based hit counter script

There are tons of free counters available on the internet. But unfortunately, most of them require you to register in their website and want a link back to their website. Also, you don’t get the full freedom to modify your image. Here is a small script using which you can easily integrate a counter in your website. You can edit the image to any type you like. You can use any font you like, use any font color you like and start the counter from any value you like. Also, you can count different pages in your website differently if you like. The script will store the visitor count in a file in your web server in any directory you want.

Three fonts, one regular English font, one Devanagari font, and one digital font are included in the zip package. You can download any ttf font and use it with your counter.  You can specify text color and background color inside your script. The script uses text file to store the counter data.  The default file name is counter.txt . You can change it inside the script. Suppose you have two pages, one “index page” and one “about page”. If you want to count the visitors of two pages separately then just specify the “page” get variable in the image url. Like, if the url of script is then you can add the hit counter to the index page as

and the about page as as

You can put all the data in a separate directory. Create a new directory “counterdata” in the same directory as the script  and set the $directory variable in the script to”counterdata/” . All the counter data will be stored in the directory.

Here are some samples of hit counter for this page:

Digital Hit counter with different background
Devanagari Hit counter
Normal Hit counter

You can view and download the project files at it’s github page.