Web Assignments
Below are the older assignments that haven't been converted to their own pages yet:
(moved)
(moved)
(moved)
Print out their input with every other letter capitalized and the others lower case
Print out their input in all caps with a space in between each letter with spaces being turned into two spaces, ex "cat dog" -> "C A T D O G"
Print out the next 20 leap years
Write a function that reverses a string
Write a function that tells if a string is a palindrome using the reverse string function you wrote
Use the more efficient way of checking for a palindrome and write a function that tells if a string is a palindrome using that
Time the execution of the reverse function vs the more efficient function over 1 million runs of each using different strings. Which is faster? Thoughts?
Write a function that tells if a string of "(" and ")" is well-formed, as in each close only happens after an open, and it ends all perfectly closed.
Make an empty array, and each time the user clicks their button add the value into the array and put the array into the div
Make an array with 100 random numbers in it
Write a function that finds the lowest number in an array, and a function that finds the highest number
Write a function that sorts an array without the use of other functions
Compare the time execution of your function compared to the built in Javascript sort function over 1 million runs. Re-randomize the array contents after each sort.
Write a function that splits a string by spaces into an array of each word
Write a string "contains" function. This should take in a string and a substring and return if the string contains the substring. Ex: ("basketball", "ball") should return true. You shouldn't need help from functions for this except for charAt.
Write a string "indexOf" function. This should take in a string and a substring and return the index of where the substring starts in the string. Ex: ("basketball", "ket") should return 3. If you don't find the substring, return -1. You shouldn't need help from functions for this except for charAt.
Write a function that reverses the order of an array in place without using another array variable.
Make a Github account.
Initialize a git project in a clean folder. Make a file that says "Hello!" in it. Check in your file with a commit message. Use instructions in Github to push the project to your Github account.
Ask the user for 4 values. x, y, width, and height. Create an object that contains all four values with keys of what the values represent, and then print that object into the output div.
Write a function that takes 2 rectangle objects as defined in the last assignment. Write a function that returns true if these rectangles overlap in space or not.
Make an array of arrays representing a dungeon tileset! (x is the first set of arrays, y is the second set of arrays). Make it 5x5 and fill each square with its x,y value, ex: "3, 4". Remember it's 0 ordered like in all code! Then, write a function to print out the dungeon in logical ordering so x goes left to right and y from top to bottom. 0,0 is in the top left corner.
Make four buttons: Up, Down, Left, Right. Make an object for your adventurer with properties x and y. Print out your dungeon with X for each square instead of the x,y in the last homework assignment, but put an O for the square where the adventurer is. When pressing the four buttons move the adventurer in that direction. Don't go out of bounds!
Generate 5 random walls in your dungeon. They will show up as W in your text output. Make sure your adventurer starts at 0,0 and make sure the 5 random walls aren't placed in the starting spot. Make sure your adventurer can't walk through the walls!
Generate a staircase at a random spot in your dungeon. Make sure it's not where a wall is or where your adventurer starts from. Make sure it's not surrounded by walls either! When your adventurer reaches the staircase, regenerate the dungeon with the adventurer starting from where he ascended the staircase, and put new random walls and random staircase around the dungeon map, as if he went upstairs.
Make the movement with with the arrow keys. Make a counter that counts up each time you go up a floor.
In a new project make a button that toggles off/on this functionality: Write "hello {i}", where i counts up each time this prints, to the console every 5 seconds
Make it so you have 5 seconds to complete each floor in the dungeon. If you don't make it in time, you lose! Make a gameover text with restart button that restarts the game. Display the time counting down every 100 milliseconds.
Achieve over 200 points on Hackerrank's Algorithm section