Skip to content

Commit 6a389f5

Browse files
authored
Update README.md for Early Access
1 parent d4fdb9f commit 6a389f5

File tree

1 file changed

+30
-6
lines changed

1 file changed

+30
-6
lines changed

README.md

+30-6
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,26 @@
11
# Fun Computer Science Projects in Python
22

3-
Source for the book *Fun Computer Science Projects in Python* by [David Kopec](https://davekopec.com).
3+
This repository contains all of the source code for the book *[Fun Computer Science Projects in Python](https://nostarch.com/fun-python-projects)* by [David Kopec](https://davekopec.com) and published by No Starch Press. The book, intended for intermediate to advanced Python programmers, features 7 projects of varying complexity from the realm of interpreters, emulators, computer art, and simple machine learning. In the table below is a description of the 7 projects and further down in this README there are directions for running (and testing) each of them. The projects are compatible with Python 3.12 and above.
4+
5+
| Project | Chapter | Section | Description |
6+
|---------------|---------|-------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
7+
| [Brainfuck](#brainfuck) | 1 | Interpreters | An interpreter for the one of the simplest possible programming languages, Brainfuck. |
8+
| [NanoBASIC](#nanobasic) | 2 | Interpreters | An interpreter for Nano BASIC, a dialect of Tiny BASIC—a programming language that was used during the personal computer revolution. |
9+
| [RetroDither](#retrodither) | 3 | Computer Art | A program that converts modern photos for display on a classic 1980s Mac by performing 1-bit (black & white) Atkinson dithering and converting them to MacPaint format. |
10+
| [Impressionist](#impressionist) | 4 | Computer Art | Impressionist uses a simple stochastic hill climbing algorithm to create abstract art from photographs that (sometimes) looks like the work of an impressionist painter. |
11+
| [Chip8](#chip8) | 5 | Emulators | An implementation of the CHIP-8 virtual machine that can play all of the 1970s games that were released for CHIP-8. |
12+
| [NESEmulator](#nesemulator) | 6 | Emulators | The simplest possible NES emulator with support for playing real games but lacking sound, performance, compatibility with most mappers, and several other features. |
13+
| [KNN](#knn) | 7 & 8 | Super Simple Machine Learning | You draw a digit and the program can interpret your drawing (KNN classification) and/or complete it (KNN regression). |
414

515
## Get the Book
616

7-
## Authorship and License
8-
9-
The code in this repository is Copyright 2024 David Kopec and released under the terms of the Apache License 2.0. That means you can reuse the code, but you must give credit to David Kopec. Please read the license for details and other requirements.
17+
[The book is available now, in its entirety, from No Starch Press.](https://nostarch.com/fun-python-projects) Although this is technically an "Early Access" eBook edition, it is essentially the same exact book as will be published by No Starch Press in print form in mid 2025. You can choose to either purchase the eBook now, or pre-purchase the print book which will also give you immediate access to the eBook.
1018

1119
## Running and Testing Each Project
1220

13-
The following directions assume you are in the root directory of the repository in a terminal and that your Python command is `python` (on some systems it is `python3`). The code is written against Python 3.12, although most of it will run with Python 3.9+.
21+
The following directions assume you are in the root directory of the repository in a terminal and that your Python command is `python` (on some systems it is `python3`). The code is tested against Python 3.12 and 3.13. It will not work with earlier versions.
22+
23+
**Please note that each project is run as a module from the main repository using the `-m` option.**
1424

1525
### Brainfuck (Chapter 1)
1626

@@ -54,6 +64,8 @@ For example:
5464

5565
### RetroDither (Chapter 3)
5666

67+
<img src="figures/figure3_2.png" alt="RetroDither MacPaint Beach Scene" height="200">
68+
5769
Dithers images into 1 bit black & white and exports them to MacPaint format.
5870

5971
#### Requirements
@@ -74,6 +86,8 @@ Additional options:
7486

7587
### Impressionist (Chapter 4)
7688

89+
<img src="figures/figure4_7.png" alt="Impressionist NYC Skyline" height="200">
90+
7791
Computationally draws abstract approximations of images using vector shapes.
7892

7993
#### Requirements
@@ -111,6 +125,8 @@ Additional options:
111125

112126
### Chip8 (Chapter 5)
113127

128+
<img src="figures/figure5_4.png" alt="Chip8 PacMan" height="200">
129+
114130
A Chip8 virtual machine.
115131

116132
#### Requirements
@@ -132,6 +148,8 @@ For example:
132148

133149
### NESEmulator (Chapter 6)
134150

151+
<img src="figures/figure6_8.png" alt="NES Emulator Brix" height="200">
152+
135153
A simple [NES](https://en.wikipedia.org/wiki/Nintendo_Entertainment_System) emulator that can play some basic public domain games.
136154

137155
#### Requirements
@@ -155,6 +173,8 @@ For example:
155173

156174
### KNN (Chapters 7 & 8)
157175

176+
<img src="figures/figure8_3.png" alt="KNN Digit Recognizer" height="200">
177+
158178
A handwritten digit recognizer using the K-nearest neighbors algorithm.
159179

160180
#### Requirements
@@ -173,4 +193,8 @@ Then use the key commands "c" to classify, "p" to predict, and "e" to erase.
173193
`python -m tests.test_knn`
174194

175195
## Type Hints
176-
The code in this repository uses the latest type hinting features in Python 3.12. If you are using an older version of Python, you may need to remove some of the type hints to run the code. All the type hints in the source code were checked using [Pyright](https://github.com/microsoft/pyright).
196+
The code in this repository uses the latest type hinting features in Python 3.12 and above. If you are using an older version of Python, you may be able to run the code by removing some of the type hints, but no support is offered for that endeavor. All the type hints in the source code were checked using [Pyright](https://github.com/microsoft/pyright).
197+
198+
## Authorship and License
199+
200+
The code in this repository is Copyright 2024 David Kopec and released under the terms of the Apache License 2.0. That means you can reuse the code, but you must give credit to David Kopec. Please read the license for details and other requirements.

0 commit comments

Comments
 (0)