Skip to content

Pygame #269

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 91 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
91 commits
Select commit Hold shift + click to select a range
d584afb
Update intro-TheWayoftheProgram.ptx
robotuw Jan 29, 2023
0b41e31
Update intro-TheWayoftheProgram.ptx
ezrichards Jan 29, 2023
e645ff0
Update intro-TheWayoftheProgram.ptx
ezrichards Jan 29, 2023
8651f0d
Update intro-TheWayoftheProgram.rst
ezrichards Jan 29, 2023
bb11f51
Update intro-TheWayoftheProgram.rst
ezrichards Jan 30, 2023
2c5ff70
Webhook test
ezrichards Jan 31, 2023
b5cad79
Update intro-TheWayoftheProgram.rst
ezrichards Feb 2, 2023
ef8f9f6
Webhook check
robotuw Feb 3, 2023
8d5dda6
Chapter Reordering Attempt 1
robotuw Feb 9, 2023
12778a6
Week1-4 Update
robotuw Feb 11, 2023
103da7b
Loops chapter revised
robotuw Feb 12, 2023
139401f
Weeks 7 and 8 Update
robotuw Feb 20, 2023
9bbbd27
W10-W13 update
robotuw Feb 21, 2023
1185f88
Fixes Batch
robotuw Mar 5, 2023
0c107b0
Name change
robotuw May 23, 2023
279e6b3
Switch to pretext
ezrichards May 24, 2023
60dcbb5
Apply classes/files/recursion changes to ptx
ezrichards May 24, 2023
6cb1be7
Add new loops sections
ezrichards May 24, 2023
886f733
Convert all remaining changes to ptx
ezrichards May 24, 2023
d7f7a00
Name Change
robotuw May 24, 2023
0f7378f
Fix 5_1_6 answers
ezrichards May 25, 2023
223da60
Fix pretext errors
ezrichards May 30, 2023
a2cbb5a
Update project settings
ezrichards May 30, 2023
c8007e8
Add list slice step info to 4.6
ezrichards Jun 6, 2023
f34b57f
Elaborate on list slice step
ezrichards Jun 8, 2023
f7f3b14
Write break/continue section
ezrichards Jun 8, 2023
0e5daa5
Fix toctree for iteration chapter
ezrichards Jun 8, 2023
1aa39f5
Update build files
ezrichards Jun 8, 2023
dd29d55
Chapter 1 Update
robotuw Jun 12, 2023
98bd4e5
Update ThewhileStatement.rst
metesaka Jun 12, 2023
9273147
Merge branch 'master' of https://github.com/CSCI128/thinkcspy
robotuw Jun 13, 2023
091c6ee
Bug Test
robotuw Jun 13, 2023
c9bb0d6
Chapters 3-8 Overhaul
robotuw Jun 13, 2023
97db00f
Chapters 8-12 Update
robotuw Jun 15, 2023
9302e19
Overhaul Complete
robotuw Jun 16, 2023
e55b735
Fix codelens spacing in break/continue section
ezrichards Jun 27, 2023
dc7a485
Update Input.ptx
metesaka Jul 1, 2023
26c2ae0
Update Logicaloperators.ptx
metesaka Jul 2, 2023
828bc7a
Update intro-HowtobeaSuccessfulProgrammer.ptx
metesaka Jul 2, 2023
92c7880
Update intro-HowtobeaSuccessfulProgrammer.ptx
metesaka Jul 2, 2023
a06e7b0
Update functions.ptx
metesaka Jul 2, 2023
9da05ed
Update FlowofExecutionSummary.ptx
metesaka Jul 3, 2023
d14546e
Update mainfunction.ptx
metesaka Jul 3, 2023
9302fb5
Update modules.ptx
metesaka Jul 3, 2023
c20b90d
Update NestedList_Navigation.ptx
metesaka Jul 3, 2023
87dd768
Update TheAccumulatorPatternwithLists.ptx
metesaka Jul 3, 2023
b2d0f4f
Update TheAccumulatorPatternwithLists.ptx
metesaka Jul 3, 2023
7bdd5b2
Activity Compile Fix
robotuw Jul 7, 2023
d3cea74
Try again
robotuw Jul 7, 2023
d69b3be
Update SpecialWaystoExecutePythoninthisBook.ptx
metesaka Jul 11, 2023
3903d09
Update Glossary.ptx
metesaka Jul 11, 2023
de9d76d
Update Glossary.ptx
metesaka Jul 11, 2023
91b02d8
Update ConditionalExecutionBinarySelection.ptx
metesaka Jul 11, 2023
9bbeceb
Update Glossary.ptx
metesaka Jul 11, 2023
af9f59d
Update Characterclassification.ptx
metesaka Jul 11, 2023
ec2fd78
Update Characterclassification.ptx
metesaka Jul 11, 2023
cc901a9
Update StringComparison.ptx
metesaka Jul 11, 2023
a42c6b9
Add files via upload
metesaka Jul 11, 2023
8e7a397
Update toctree.ptx
metesaka Jul 11, 2023
9ab17af
Update toctree.ptx
metesaka Jul 11, 2023
d87ddde
Update KnowyourerrorMessages.ptx
metesaka Jul 11, 2023
a951fe1
Expanded Last Chapter
robotuw Jul 13, 2023
a47f06c
Removed CSV
robotuw Jul 13, 2023
ca8a834
Video Lectures Added
robotuw Jul 13, 2023
749d7a1
Removed codelens with input
robotuw Jul 13, 2023
f38fdcd
Buggy Content Fixes
robotuw Jul 13, 2023
7a31cfb
Update fStrings.ptx
robotuw Aug 6, 2023
7c05872
Update intro-VariablesExpressionsandStatements.ptx
robotuw Aug 10, 2023
d3ceee9
Update UpdatingVariables.ptx
robotuw Aug 11, 2023
31d9eb5
Update simpledata video
ezrichards Aug 14, 2023
7687829
Update all videos and add week 15 video
ezrichards Aug 14, 2023
d8a93f0
Bug fixes (#2)
ezrichards Dec 30, 2023
5710931
Extra Topics (#1)
ezrichards Jan 5, 2024
1cdd53c
Chapter and section revisions (#3)
metesaka Jan 6, 2024
6b21168
Minor typo fixes and wording changes
robotuw Jan 6, 2024
68cc7c2
Update pretext and broken chapter
ezrichards Aug 31, 2024
90dd815
Update README
ezrichards Sep 7, 2024
d5fd0a9
Update README
ezrichards Sep 7, 2024
a8222db
Update README
ezrichards Sep 7, 2024
efd780e
Fix 12.3 issues
ezrichards Oct 30, 2024
5e4361a
Fix examples (#6)
ezrichards Dec 13, 2024
be3d68f
rename ids (#5)
ezrichards Dec 13, 2024
1d721f0
add section on variable agg shorthand (#4)
ezrichards Dec 13, 2024
9164b2f
disable ptx stuff
ezrichards Dec 13, 2024
777b2e1
File fixes (#9)
ezrichards Jan 2, 2025
17318ec
File fixes (#10)
ezrichards Jan 2, 2025
69ca69c
fix note again?
ezrichards Jan 2, 2025
c800516
Fix notes
ezrichards Jan 3, 2025
fa03d49
Fix quote issue
ezrichards Jan 14, 2025
da12ef3
Fix pseudocode section prompt
ezrichards Jan 25, 2025
6999dfe
All pygame additions
jettMorrandez Apr 16, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
89 changes: 89 additions & 0 deletions .devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
// (delete the above line to manage this file manually)
//////////////////////////////////////////////////////////////
//
// This file provides configuration options so that a PreTeXt
// project can be edited and built using GitHub's Codespaces.
// It is recommended to keep this in your repository even if you
// do not use this feature, as it will allow other to explore
// your project easily.
// This file will be automatically generated by PreTeXt with the
// latest updates unless you remove the first comment line above.
//
///////////////////////////////////////////////////////////////

// commented out because we're not using this but ptx generates it automatically.

// {
// "name": "PreTeXt-Codespaces",

// // This Docker image includes some LaTeX support, but is still not to large. Note that if you keep your codespace running, it will use up your GitHub free storage quota. Additional options are listed below.
// "image": "oscarlevin/pretext:small",
// // If you need to generate more complicated assets (such as sageplots) or use additional fonts when building to PDF, comment out the above line and uncomment the following line.
// // "image": "oscarlevin/pretext:full",
// // If you only intend to build for web and don't have any latex-image generated assets, you can use a smaller image:
// // "image": "oscarlevin/pretext:lite",

// // Add gh cli as a feature (to support codechat)
// "features": {
// "ghcr.io/devcontainers/features/github-cli:1": {}
// },

// // Respect the project's designated dependencies
// "postCreateCommand": "pip install -r requirements.txt",

// // Port forwarding
// // ---------------
// // This is needed by the CodeChat Server.
// "forwardPorts": [
// // The port used for a Thrift connection between the VSCode CodeChat
// // extension and the CodeChat Server.
// 27376,
// // The port used for an HTTP connection from the CodeChat Client to
// // the CodeChat Server.
// 27377,
// // The port used by a websocket connection between the CodeChat
// // Server and the CodeChat Client.
// 27378
// ],
// // See the [docs](https://containers.dev/implementors/json_reference/#port-attributes).
// "portsAttributes": {
// "27376": {
// "label": "VSCode extension <-> CodeChat Server",
// "requireLocalPort": true
// },
// "27377": {
// "label": "CodeChat Client",
// "requireLocalPort": true
// },
// "27378": {
// "label": "CodeChat Client<->Server websocket",
// "requireLocalPort": true
// // This port needs to be public; however, there's no way to specify port visibility here. See `server.py` in the CodeChat Server for details.
// }
// },

// // Configure tool-specific properties.
// "customizations": {
// "codespaces": {
// "openFiles": ["source/main.ptx"]
// },
// "vscode": {
// "settings": {
// "editor.quickSuggestions": {
// "other": "off"
// },
// "editor.snippetSuggestions": "top",
// "xml.validation.enabled": false,
// "CodeChat.CodeChatServer.Command": "CodeChat_Server"
// },
// "extensions": [
// "ms-vscode.live-server",
// "oscarlevin.pretext-tools",
// "CodeChat.codechat"
// ]
// }
// }

// // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// // "remoteUser": "root"
// }
57 changes: 57 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
"name": "PreTeXt-Codespaces",

// This Docker image includes some LaTeX support, but is still not to large. Note that if you keep your codespace running, it will use up your GitHub free storage quota. Additional options are listed below.
"image": "oscarlevin/pretext:small",
// If you need to generate more complicated assets (such as sageplots) or use additional fonts when building to PDF, comment out the above line and uncomment the following line.
// "image": "oscarlevin/pretext:full",
// If you only intend to build for web and don't have any latex-image generated assets, you can use a smaller image:
// "image": "oscarlevin/pretext:lite",



// The following was the previous version of this file, which used the Codespaces base image. It is still available for reference, but is not recommended.
// "image": "mcr.microsoft.com/devcontainers/python:3",
// "features": {
// "ghcr.io/devcontainers/features/node:1": {},
// "ghcr.io/rocker-org/devcontainer-features/pandoc:1": {}
// },
// "forwardPorts": [
// 27377,
// 27378
// ],
// "portsAttributes": {
// "27378": {
// "label": "CodeChat",
// "onAutoForward": "openPreview",
// "requireLocalPort": true,
// "elevateIfNeeded": true,
// "protocol": "https"
// }
// },
// "onCreateCommand": "pip install pretext",
// // Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "sudo bash ./.devcontainer/postCreateCommand.sh",

// Configure tool-specific properties.
"customizations": {
"codespaces": {
"openFiles": [
"source/main.ptx"
]
},
"vscode": {
"settings": {
"editor.quickSuggestions": {
"other": "off"
},
"editor.snippetSuggestions": "top",
"xml.validation.enabled": false
},
"extensions": ["ms-vscode.live-server", "oscarlevin.pretext-tools"]
}
}

// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}
94 changes: 94 additions & 0 deletions .github/workflows/pretext-cli.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
# (delete the above line to manage this file manually)

# commented out because we're not using this but ptx generates it automatically.

# name: PreTeXt-CLI Actions
# on:
# # Runs on pull requests
# pull_request:
# branches: ["*"]
# # Runs on pushes to main
# push:
# branches: ["main"]
# # Runs on demand
# workflow_dispatch:

# jobs:
# build:
# runs-on: ubuntu-latest
# container: oscarlevin/pretext:full

# steps:
# - name: Checkout source
# uses: actions/checkout@v4

# - name: install deps
# run: pip install -r requirements.txt

# - name: build deploy targets
# run: pretext build --deploys
# - name: stage deployment
# run: pretext deploy --stage-only

# - name: Bundle output/stage as artifact
# uses: actions/upload-artifact@v4
# with:
# name: deploy
# path: output/stage

# deploy-cloudflare:
# runs-on: ubuntu-latest
# needs: build
# if: vars.CLOUDFLARE_PROJECT_NAME != ''
# permissions:
# contents: read
# deployments: write

# steps:
# - name: Download artifact
# uses: actions/download-artifact@v4
# with:
# name: deploy
# path: deploy
# - name: Create 404.html
# run: echo "404 page not found" >> deploy/404.html
# - name: Publish to Cloudflare
# uses: cloudflare/pages-action@v1
# with:
# apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
# accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
# projectName: ${{ vars.CLOUDFLARE_PROJECT_NAME }}
# gitHubToken: ${{ secrets.GITHUB_TOKEN }}
# branch: ${{ github.head_ref || github.ref_name }}
# directory: deploy

# deploy-ghpages:
# runs-on: ubuntu-latest
# needs: build
# if: vars.PTX_ENABLE_DEPLOY_GHPAGES == 'yes' && github.ref == format('refs/heads/{0}', github.event.repository.default_branch)
# permissions:
# contents: read
# pages: write
# id-token: write
# concurrency:
# group: "page"
# cancel-in-progress: false
# environment:
# name: github-pages
# url: ${{ steps.deployment.outputs.page_url }}
# steps:
# - name: Download website artifact
# uses: actions/download-artifact@v4
# with:
# name: deploy
# path: deploy
# - name: Setup GitHub Pages
# id: check
# uses: actions/configure-pages@v4
# - name: Upload artifact
# uses: actions/upload-pages-artifact@v3
# with:
# path: deploy
# - name: Deploy to Github Pages
# id: deployment
# uses: actions/deploy-pages@v4
105 changes: 105 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# (delete the above line to manage this file manually)
__pycache__/
build_info
build
Expand All @@ -19,3 +20,107 @@ beta
output
published
pdf
venv/
cli.log

# Boilerplate list of files in a PreTeXt project for git to ignore
# ensure this file is tracked
!.gitignore

# don't track unpublished builds or stage (note: Runestone uses `published`)
output
published

# don't track assets generated from source
generated-assets

# don't track the executables.ptx file
executables.ptx

# don't track node packages
node_modules

# don't track error logs
.error_schema.log
logs

# don't track OS related files (windows/macos/linux)
.DS_Store
.DS_Store?
._*
.AppleDouble
.LSOverride
.Spotlight-V100
.Trashes
Icon
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
Thumbs.db
Thumbs.db:encryptable
ehthumbs.db
ehthumbs_vista.db
*.stackdump
*.lnk
*.cab
*.msi
*.msix
*.msm
*.msp
[Dd]esktop.ini
.directory
.fuse_hidden*
.Trash-*
.nfs*

# Don't include VSCode generated files
.vscode
*.code-workspace

# Don't inlucde SublimeText files
# Cache files for Sublime Text
*.tmlanguage.cache
*.tmPreferences.cache
*.stTheme.cache

# Workspace files are user-specific
*.sublime-workspace

# Project files should be checked into the repository, unless a significant
# proportion of contributors will probably not be using Sublime Text
*.sublime-project

# SFTP configuration file
sftp-config.json
sftp-config-alt*.json

# Package control specific files
Package Control.last-run
Package Control.ca-list
Package Control.ca-bundle
Package Control.system-ca-bundle
Package Control.cache/
Package Control.ca-certs/
Package Control.merged-ca-bundle
Package Control.user-ca-bundle
oscrypto-ca-bundle.crt
bh_unicode_properties.cache

# Sublime-github package stores a github token in this file
# https://packagecontrol.io/packages/sublime-github
GitHub.sublime-settings


# Don't include Dropbox settings and caches
.dropbox
.dropbox.attr
.dropbox.cache

# Don't track codechat config (will be generated automatically)
codechat_config.yaml

# Don't track deprecated workflows
.github/workflows/deploy.yml
.github/workflows/test-build.yml
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# How to Think Like a Computer Scientist: Mines Edition
This is a fork of the original [thinkcspy](https://github.com/runestoneinteractive/thinkcspy) made for Colorado School of Mines CSCI128:

> This project began with the original How to Think Like a Computer Scientist text by Jeffrey Elkner, Peter Wentworth, Allen B. Downey, Chris Meyers, and Dario Mitchell. Since 2011 Brad Miller, David Ranum, Barbara Ericson, Mark Guzdial, and many others have built on the text making it interactive.

> Programming is not a "spectator sport". It is something you do, something you participate in. It would make sense, then, that the book you use to learn programming should allow you to be active. That is our goal.

> This book is meant to provide you with an interactive experience as you learn to program in Python. You can read the text, watch videos, and write and execute Python code. In addition to simply executing code, there is a unique feature called 'codelens' that allows you to control the flow of execution in order to gain a better understanding of how the program works.

*Note: RST is deprecated, and the new pretext sources are in the pretext folder, but we will keep the _sources (old RST folder) directory until we are 100% sure that the book has been converted correctly and as thoroughly as possible.*

## Development Environment
Create and activate a virtual environment and install dependencies:

`python -m venv venv`

`source venv/bin/activate`

`pip install -r requirements.txt`

Then build the textbook: `pretext build web`

..and finally, run the web server: `pretext view`
Loading