Skip to content

Programming problems, done within a repo for use of pull requests

License

Notifications You must be signed in to change notification settings

6KidsGames/Prog

Repository files navigation

Prog

6KidsGames Logo

Programming problems, done within a repo so we can all see each other's code and the teacher can grade your results.

Using This Repo

Folder structure

The 'users' folder contains one folder per student. Within each student folder we store:

  • Source code files like 'Arrays.js' and other files we use t osolve weekly classes.
  • Jupyter JavaScript notebooks assigned by the instructor.

The 'users/Answer' folder will be updated with the problems and one possible answer after class, for those who missed it.

Getting started - First Time Setup

  1. Install Git from https://git-scm.com/download/win (for Windows), or https://git-scm.com/download for other operating systems.
  2. Install Node.js from https://nodejs.org (click the Current button to get the latest).
  3. Install Visual Studio Code from https://www.visualstudio.com/products/code-vs
  4. Install Anaconda from https://www.continuum.io/downloads - choose the Windows 64-bit installer
  5. Open a Windows console: Windows+R (to open the Run box), then type cmd and press Enter.
  6. Create a new folder: mkdir c:\Prog
  7. Move to that folder: cd c:\Prog
  8. Clone the Git repo to your new folder: git clone https://github.com/6KidsGames/Prog .

Every day - pulling code and installing updates

When you're developing code with a team, you're going to need to get their code as well as upload your code. A good time to do this is at the start of each day, unless you're in the middle of something.

  1. (If you don't already have a console open) Open a Windows console: Windows+R (to open the Run box), then type cmd and press Enter.
  2. Change location to that folder: cd c:\Prog
  3. Create some useful console shortcuts: init
  4. See if you have any files changed locally, and if you're in a working branch: stat
  5. If you are not on the master branch, run git checkout master
  6. If "package.json" is listed in red, run git checkout -- package.json
  7. If you have other files changed, get it committed and git checkout master, or talk to the teacher.
  8. Pull down the latest code: pull
  9. Run Setup.cmd (which installs the latest packages from the Internet) by entering: Setup

Every day - Running Jupyter

When we are using Jupyter notebooks, you need to run the Jupyter server, which uses Node.js. To run Jupyter we have a script command that you run from within your c:\Prog folder:

jupyter

Every day - Creating and Running JavaScript Code

We also create our own JavaScript code using Visual Studio Code, and run it with node.js.

To edit your code:

  1. Change to your user directory: cd c:\Prog\users\<your-user-name> (Obviously, replace with the folder name for yourself.)
  2. Run Visual Studio Code in that directory: code .
  3. If you need to create a new JavaScript program file, use the File menu's New command, then save the resulting file with a new filename as directed during class. Use the ".js" extension which is the extension for JavaScript.

To run your code:

  1. Alt+Tab back to the cmd console window
  2. Use NodeJS to run your code: node myfile.js For example: node Arrays.js

Every day - Pushing Your Results to the Repo on GitHub

Unlike our other code projects like ZombAttack, all users in class can push to the cloud. So all you need to do is to check in your changes to master, then push to the cloud, and pull back again to get the latest code.

You can do this quickly using the helper script in c:\Prog: PushMyWork

About

Programming problems, done within a repo for use of pull requests

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published