Welcome to BHS Computer Science. If you are a student in the class, the first thing you need to do (and which we should have done in class) is set up your GitHub account.
Once you have a GitHub account, click “Log in to GitHub” below to proceed. Or you can click “Use anonymously” to play with the environment but you will not be able to save your work or submit assignments. (You can always log in later by clicking the at the top of the page.)
If you don’t have a GitHub account yet, please create one and then log in here for further instructions.
Congratulations! You have successfully connected this app to GitHub. However you are not yet a member of the GitHub organization for this class, something Mr. Seibel needs to set up for you.
This is your GitHub profile URL:
Click the clipboard icon to copy it and then submit it at this form so he can add you.
Congratulations! You have successfully connected this app to GitHub. And it looks like you have an invitation to join the GitHub organization for this class. You need to accept that invitation before you can proceed. The invite should be sent to whatever email you used when you created your GitHub account.
I see you are logged into GitHub and a member of the berkeley-high-cs GitHub organization. However there seems to have been some problem finishing the setup for your account. Please let Mr. Seibel know.
This is a tool for the BHS Computer Science class at Berkeley High School. It is intended to provide a simple environment for experimenting with Javascript without all the complexities of a full development environment such as ReplIt or Glitch which we may use later in the year.
It is also designed to take advantage of the browser’s ability to run Javascript natively. It does not need access to a server to run code making in extremely responsive even if the Wifi is flaking out.
Finally, under the covers it is saving work to a GitHub repository in a very simplified workflow that does not depend on immediately learning any git commands. Code written in this environment for each assignment is saved to a directory and branch specific to that assignment each time it is saved. Thus when the assignment is done, it is easy to go to GitHub and create a PR containing just the work on that assignment which can then be commented on and worked on further before it is turned in and merged to main.
You're all set! You don't need to worry about this yet but we have successfully created a GitHub repository for your work:
You can get to it any time by clicking on your GitHub username at the top-right of the screen.
A function that takes a single object as its argument and returns the value of the object's x property.
A function that takes two numeric arguments representing x and y coordinates and returns an object with those values as x and y properties.
A function that takes no arguments and returns an empty object, i.e. one with no properties.
A function that takes two point objects like the ones returned by the point function you just wrote and returns the Euclidean distance between the two points, i.e. the square root of the sum of the square of the distance on the x-axis and the square of the distance on the y-axis.
A function that takes two point objects and returns the point midway between the two points. You can find this point by computing the x coordinate midway between the two points' x coordinates and the y coordinate midway between the two points' y coordinates.
A function that takes an array of objects, each of which has a property salary, and returns the sum of all the objects' salaries.
A function that takes two arguments, the current high score in a game
and an array of player objects, each of which has a
score
property, and returns the new high score (which
could be the old high score if none of the players has a better
score).
A function that takes a single argument of an array of book objects.
Each book object has
title
and pages
proprties. Return a single
object containing a titles
property containing a list of
all the titles and a pages
property containing total
number of pages in all the books.
The goal of this exercise is to write functions in the editor to the left that pass test cases for the functions shown below. Whenever you are ready to run the tests, hit the button above the editor. To see the specification for a function you are supposed to write, click a button in the test panel. (You will need to click the once first.) Once you have written the function with the right name, the button will indicate whether the test cases are all passing (green, with a ✅) or some are failing (red, with an ❌) and clicking the button will show the results of the individual test cases.