Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
A multithreaded programming demonstration in Python & Pygame using a "Nibbles" clone.
Python
Branch: master

Switching to a Lock object for each cell instead of one for everythin…

…g. Still has some slight bugs when the field is crowded with worms. (Grep for 'chop' to find relevant comment.)
latest commit 40af9ca9c4
@asweigart authored

README.md

threadworms

A multithreaded programming demonstration in Python & Pygame using a "Nibbles" clone.

Demo is on the Invent with Python Blog

This Python & Pygame script shows a simple window where "worms" of various lengths and speed run around. The program demonstrates multithreaded programming and using locks to make the code threadsafe (worms will never go through each other.)

This code works with either Python 3 or Python 2. You need Pygame installed to run it.

Uncomment the setGridSquares() function call to draw static squares on the map, instead of having a completely open field. You can also try adjusting the constants at the top of the file.

Something went wrong with that request. Please try again.