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 string and returns the index of the first occurrence of 'fnord' in the string or -1 if there is no such occurrence.
A function that takes two string arguments and returns a boolean indicating whether the first argument contains the second, i.e. is the second string a substring of the first string.
A function that takes a single string argument (which will be at least two characters long) and returns a string consisting of just the first and last characters of the string.
A function that takes a single string argument and returns a string consisting of the second half of the original string followed by the first half. If the string is an odd number of characters it should include the extra charcater in the (original) front half.
A function that takes two arguments, a string containing a single word and a number indicating the index of the first vowel in the word, and returns the word translated into Pig Latin according to the simple rule of always adding 'ay'
A function that that takes a single string argument and returns a boolean indicating whether the string is all upper case.
A function that takes two string arguments and returns a boolean indicating whether they are the same string if you ignore case differences.
A function that that takes a single string argument and returns the first half of the string. If the string has an odd number of characters the first half should be the shorter of the two parts.
A function that that takes a single string argument and returns the second half of the string. If the string has an odd number of characters it the second half should be the longer of the two parts.
A function that takes a string and returns a string consisting of the original string in all uppercase followed by the original string in all lower case.
A function that takes a single string, which will be at least five characters long, and returns a string consisting of the first, third, and fifth characters.
A function that takes a single string and returns a string consisting of the last character repeated twice, once in uppercase and the in lower case.
A function that given a string containing a full name consisting of a first name, a space, and a last name returns the first name. (Note, actual names are way more complicated than that. Almost nothing you think is true about names is likely actually true.)
A function that given a string containing a full name consisting of a first name, a space, and a last name returns the last name. (Note, actual names are way more complicated than that. Almost nothing you think is true about names is likely actually true.)
A function that takes two strings and returns a string consisting of the two strings concatenated (smooshed together).
A function that takes a string argument and returns the first character of the string.
A function that takes a string and returns the last character of the string.
A function that takes a string and returns a string consisting of all but the first character of the original string.
A function that takes a string that is at least three characters long and returns a string consisting of the first three characters of teh original string.
A function that takes a string and returns a string consisting of all but the first and last characters of the original string.
A function that takes a string that is at least three characters long and returns a string consisting of the last three characters of the original string.
A function that takes a string and returns a capitalized version of the string (first character in upper case and remaining characters in lower case).
A function that takes a string and returns a version of the string with the first three characters in upper case and remaining characters in lower case.
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.