Example: dental hygienist

THE BIG BOOK OF SMALL PYTHON PROJECTS

AL SWEIGARTTHE BIG BOOK OF SMALL PY THONPROJECTS81 EASY PRACTICE PROGRAMSTHE BIG BOOK OF SMALL PYTHON PROJECTSSan FranciscoAl SweigartTHE BIG BOOK OF SMALL PYTHON PROJECTS81 Easy Practice ProgramsTHE BIG BOOK OF SMALL PYTHON PROJECTS . Copyright 2021 by Al Sweigart. All rights reserved. No part of this work may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying, recording, or by any information storage or retrieval system, without the prior written permission of the copyright owner and the : 978 -1-7185- 0124 -9 (print) ISBN-13: 978 -1-7185- 0125- 6 (ebook)Publisher: William Pollock Production Manager: Rachel Monaghan Production Editor: Paula Williamson Developmental Editor: Frances Saux Technical Reviewer: Sarah Kuchinsky Cover and Interior Design: Octopod Studios Cover Illustrator: Josh Ellingson Copyeditor: Bart Reed Compositor: Maureen Forys, Happenstance Type-O-Rama Proofreader: Scout FestaFor information on book distributors or translations, please contact No Starch Press, Inc.

Project 44, Maze Runner 2D: Try to escape a maze. 213 Read maze data from text files. Project 45, Maze Runner 3D: Try to escape a maze . . . in 3D! 219 Modify multiline strings to display a 3D view. Project 46, Million Dice Roll Statistics Simulator: Explore the probability results of rolling a set of dice one million times. 228

Tags:

  Mazes, Runner, Maze runner

Information

Domain:

Source:

Link to this page:

Please notify us if you found a problem with this document:

Other abuse

Transcription of THE BIG BOOK OF SMALL PYTHON PROJECTS

1 AL SWEIGARTTHE BIG BOOK OF SMALL PY THONPROJECTS81 EASY PRACTICE PROGRAMSTHE BIG BOOK OF SMALL PYTHON PROJECTSSan FranciscoAl SweigartTHE BIG BOOK OF SMALL PYTHON PROJECTS81 Easy Practice ProgramsTHE BIG BOOK OF SMALL PYTHON PROJECTS . Copyright 2021 by Al Sweigart. All rights reserved. No part of this work may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying, recording, or by any information storage or retrieval system, without the prior written permission of the copyright owner and the : 978 -1-7185- 0124 -9 (print) ISBN-13: 978 -1-7185- 0125- 6 (ebook)Publisher: William Pollock Production Manager: Rachel Monaghan Production Editor: Paula Williamson Developmental Editor: Frances Saux Technical Reviewer: Sarah Kuchinsky Cover and Interior Design: Octopod Studios Cover Illustrator: Josh Ellingson Copyeditor: Bart Reed Compositor: Maureen Forys, Happenstance Type-O-Rama Proofreader: Scout FestaFor information on book distributors or translations, please contact No Starch Press, Inc.

2 Directly: No Starch Press, Inc. 245 8th Street, San Francisco, CA 94103 phone: 1-415-863-9900; of Congress Control Number: 2021936413No Starch Press and the No Starch Press logo are registered trademarks of No Starch Press, Inc. Other product and company names mentioned herein may be the trademarks of their respective owners. Rather than use a trademark symbol with every occurrence of a trademarked name, we are using the names only in an editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the information in this book is distributed on an As Is basis, without warranty. While every precaution has been taken in the preparation of this work, neither the author nor No Starch Press, Inc. shall have any liability to any person or entity with respect to any loss or damage caused or alleged to be caused directly or indirectly by the information contained in the AuthorAl Sweigart is a software developer, author, and Fellow of the PYTHON Software Foundation.

3 He was previously the education director at Oakland, California s video game museum, The Museum of Art and Digital Enter-tainment. He has written several programming books, including Automate the Boring Stuff with PYTHON and Invent Your Own Computer Games with PYTHON . His books are freely available under a Creative Commons license at his website His cat Zophie loves eating nori seaweed the Technical ReviewerSarah Kuchinsky, MS, is a corporate trainer and consultant. She uses PYTHON for a variety of applications, including health systems modeling, game development, and task automation. Sarah is a co-founder of the North Bay PYTHON conference, tutorials chair for PyCon US, and lead organizer for PyLadies Silicon Valley. She holds degrees in Management Science & Engineering and IN DETAILI ntroduction xvProject 1, Bagels: Deduce a secret three-digit number based on clues.

4 1 Practice using 2, Birthday Paradox: Determine the probability that two people share the same birthday in groups of different sizes. 6 Use PYTHON s datetime 3, Bitmap Message: Display a message on the screen configured by a 2D bitmap image. 11 Work with multiline 4, Blackjack: A classic card game played against an AI dealer. 15 Learn about Unicode characters and code 5, Bouncing DVD Logo: Simulates the colorful bouncing DVD logo of decades past. 23 Work with coordinates and colorful 6, Caesar Cipher: A simple encryption scheme used thousands of years ago. 29 Convert between letters and numbers to perform math on 7, Caesar Hacker: A program to decrypt Caesar cipher messages without the encryption key.

5 33 Implement a brute-force cryptanalysis 8, Calendar Maker: Create calendar pages for a given year and month. 36 Use PYTHON s datetime module and the timedelta data 9, Carrot in a Box: A silly bluffing game between two players. 41 Create ASCII 10, Cho-Han: A gambling dice game from feudal Japan. 47 Practice using random numbers and dictionary data Contents in DetailProject 11, Clickbait Headline Generator: A humorous headline generator for your content farm. 51 Practice string manipulation and text 12, Collatz Sequence: Explore the simplest impossible conjecture in mathematics.

6 56 Learn about the modulus 13, Conway s Game of Life: The classic cellular automata whose simple rules produce complex emergent behavior. 59 Use dictionary data structures and screen 14, Countdown: A countdown timer with a seven-segment display. 63 Practice importing modules you 15, Deep Cave: A tunnel animation that descends endlessly into the earth. 66 Use string replication and simple 16, Diamonds: An algorithm for drawing diamonds of various sizes. 69 Practice your pattern recognition skills to create drawing 17, Dice Math: A visual dice-rolling math game.

7 73 Use dictionary data structures for screen 18, Dice Roller: A tool for reading Dungeons & Dragons dice notation to generate random numbers. 79 Parse text to identify key 19, Digital Clock: A clock with a calculator-like display. 83 Generate numbers that match information from the datetime 20, Digital Stream: A scrolling screensaver that resembles The Matrix. 86 Experiment with different animation 21, DNA Visualization: An endless ASCII-art double helix that demonstrates the structure of DNA. 90 Work with string templates and randomly generated 22, Ducklings: Mix and match strings to create a variety of ASCII-art ducks.

8 94 Use object-oriented programming to create a data model for duck in Detail ixProject 23, Etching Drawer: Move the cursor to create line drawings. 100 Work with screen coordinates and relative directional 24, Factor Finder: Find all the multiplicative factors of a number. 106 Use the modulus operator and PYTHON s math 25, Fast Draw: Test your reflexes to see if you re the fastest keyboard in the West. 110 Learn about the keyboard 26, Fibonacci: Generate numbers in the famous Fibonacci sequence. 113 Implement a rudimentary mathematics 27, Fish Tank: A colorful, animated ASCII-art fish tank.

9 117 Use screen coordinates, text colors, and data 28, Flooder: Attempt to fill the entire puzzle board with one color. 125 Implement the flood fill 29, Forest Fire Sim: Simulate the spread of wildfires through a forest. 132 Create a simulation with adjustable 30, Four in a Row: A board game where two players try to connect four tiles in a row. 137 Create a data structure that mimics 31, Guess the Number: The classic number guessing game. 143 Program basic concepts for 32, Gullible: A humorous program to keep gullible people busy for hours. 147 Use input validation and 33, Hacking Minigame: Deduce a password based on clues.

10 150 Add cosmetic features to make a basic game more 34, Hangman and Guillotine: The classic word guessing game. 156 Use string manipulation and ASCII 35, Hex Grid: Programmatically generate tiled ASCII art. 162 Use loops to make repeating text Contents in DetailProject 36, Hourglass: A simple physics engine for falling sand. 165 Simulate gravity and use collision 37, Hungry Robots: Avoid killer robots in a maze. 171 Create a simple AI for robot 38, J Accuse!: A detective game to determine liars and truth-tellers. 178 Use data structures to generate relationships between suspects, places, and item 39, Langton s Ant: A cellular automata whose ants move according to simple rules. 186 Explore how simple rules create complex graphical 40, Leetspeak: Translate English messages into l33t5p34]<.


Related search queries