PitchHut logo
Log in / Sign up
FunComputerScienceProjectsInPython
by new_bronze_lyn
Explore engaging Python projects for aspiring programmers.
Pitch

This repository houses the source code for 'Fun Computer Science Projects in Python,' a book that guides Python developers through a variety of intriguing projects. With insights into interpreters, emulators, and computer art, it offers practical learning for those looking to enhance their programming skills.

Description

This repository serves as the official source code for the book Fun Computer Science Projects in Python authored by David Kopec and published by No Starch Press. Targeted at intermediate to advanced Python programmers, the book features seven diverse projects that explore interpreters, emulators, computer art, and introductory machine learning concepts. These projects are designed to be compatible with Python version 3.12 and above.

Project Overview

Below is a comprehensive list of the seven projects included in the book along with a brief description of each:

ProjectChapterSectionDescription
Brainfuck1InterpretersAn interpreter for Brainfuck, one of the simplest programming languages.
NanoBASIC2InterpretersAn interpreter for Nano BASIC, a simplified dialect of Tiny BASIC, which played a significant role during the personal computer revolution.
RetroDither3Computer ArtA program that applies 1-bit Atkinson dithering to modern photos, converting them into black and white images for classic Mac display in MacPaint format.
Impressionist4Computer ArtUtilizes a stochastic hill climbing algorithm to generate abstract art from photographs, resembling the style of impressionist painters.
Chip85EmulatorsAn emulator for the CHIP-8 virtual machine, allowing users to play vintage games from the 1970s.
NESEmulator6EmulatorsA basic NES emulator that enables playing select public domain games but with limited features and capabilities.
KNN7 & 8Super Simple Machine LearningA drawing recognition tool that interprets user sketches of digits using K-nearest neighbors classification and can also complete them through regression.

Running and Testing Projects

Each project can be executed as a module using the -m option from the root directory. The code is validated against Python versions 3.12 and 3.13, and prior versions are not supported. Below is an example command structure for executing the projects:

python -m ProjectName <your_file_name>

Example command for the Brainfuck interpreter:

python -m Brainfuck Brainfuck/Examples/beer.bf

Type Hints

The repository fully utilizes the advanced type hinting features introduced in Python 3.12 and above. While the code may be run in earlier versions of Python by removing certain type hints, no support is provided for such modifications. All type hints were thoroughly verified using Pyright.

This repository offers a unique blend of programming exercises aiming to enhance coding skills and enrich understanding of Python programming through practical implementation.

0 comments

No comments yet.

Sign in to be the first to comment.