Note: Some students have reported versioning issues when cloning down npm-managed projects from GitHub and reinstalling packages with
$ npm install or re-creating a deleted node_modules directory with
$ npm install. This is a known issue outlined in this GitHub issue discussion. If you encounter this, we recommend removing your node_modules directory (if present), updating the webpack version in your package.json file to look like this:
"webpack": "4.19.1" (notice the version number is not preceded by a
^), and recreating node_modules with the
$ npm install command.
Goal: Continue to practice testing with Jasmine/Karma and implement ES6 features along the way. You should use
const instead of
var, ES6 classes, and template literals where needed. Test each part of your code in isolation and focus primarily on the business logic.
const? How are they an improvement over
classkeyword in our code? What does it do?
This prompt is designed to get you practicing with the
Date object. You will be expected to use the
Date object on Friday.
Create an app for calculating the day for any given date. The user should be able to enter ina date and see what day of the week that date occured on. If you enjoy brain teasers, try to work out your own algorithm. If you need help getting started, check out the Wikipedia article. The program should be able to handle past dates, future dates, and invalid dates (user should be notified if the date is invalid).
A haiku is a poem that consists of three lines. The first has five syllables, the second has seven, and the third has five. Start by creating an application that checks whether a poem is in fact a haiku. If you have time, build out your application so that it can randomly generate haikus.
This project provides an excellent opportunity for BDD with Jasmine.
Make sure you test your application for each new rule you implement.
An RPG (Role Playing Game) is a game where players assume the roles of characters in a fictional world. Build and fully unit test the business logic for a Medieval Role Playing Game (or another genre that you prefer: sci-fi, cyberpunk, '80's high school).
Logic could include the following:
Character creation: Use ES6 classes to generate different character types. Be creative with your character types… warriors, wizards, scientists, prom queen… whatever! Characters should have specific attributes. For instance, in a medieval RPG, characters might have
intelligence attributes among others. In an '80's high school RPG, characters might have
Battle system: Many RPGs have a battle system so characters can fight monsters, though that could just as easily be a high school “battle” system where the prom queen has a dance-off with the theater aficionado. Determine conditions for “winning” a battle, whether that's defeating monsters (with swords and spells doing damage), accumulating dance-off style points, or any other system you think of.
Level up: Determine a leveling system. Characters should be able to go from Level 1 to Level 2 and so on. Generally each level comes with new abilities. How do characters level up in your game? What attributes and powers do they gain? Does their
strength go up or do they learn new spells?
Inventory: Characters should be able to have items that enhance their abilities. Maybe the Magic Armor increases their defense power or legwarmers increase their dance-off ability. Create a limit to the number of items a character can have. Characters should be able to add, drop, buy and sell items.