在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:ironhack-labs/lab-javascript-clue开源软件地址:https://github.com/ironhack-labs/lab-javascript-clue开源编程语言:JavaScript 95.6%开源软件介绍:LAB | JS Clue - Mixing objects and arraysDo you remember the classic detective board game Clue? It was a very popular game in the 90's. The plot starts with the death of Mr. Boddy, the very wealthy owner of Tudor Manor. He was killed under highly suspicious circumstances, and it's the player's mission to uncover which suspect murdered him, what weapon was used, and in which room of the mansion the crime took place. When playing Clue, these three details are represented by a suspect card, a weapon card and a room card that are kept hidden in an envelope for the duration of the game. By progressively revealing the remaining cards, the players can infer which are the three cards that are hidden. When a player is confident that they know the solution to the mystery, they will try to reveal it. If a player guesses correctly, they win the game. Requirements
Submission
git add .
git commit -m "done"
git push origin master
InstructionsYou will be working in the To run the JavaScript code, open the To see the output of your JavaScript code, open the Console in the Developer Tools. Note about testsThis LAB is equipped with unit tests to provide automated feedback on your lab progress. After completing the basic iterations, go to the "Test Your Code" section at the bottom. There you'll be asked to install the testing dependencies and run the tests to check how many tests your code is passing. Once you run the tests, correct your code to pass the failing tests. Iteration 1: Create the cardsClue has three different card types: suspects, rooms, and weapons. Let's create an All of the information you need about suspects, rooms, and weapons can be found on the Suggestion: Copy this data into the SuspectsAll of six possible suspects in Clue have a first name, last name, occupation, age, description, image and color. To complete this iteration, you should have an array that looks something like the following: const suspectsArray = [
{
firstName: 'Jacob',
lastName: 'Green',
occupation: 'Entrepreneur'
// ...
}
// ...
]; WeaponsThere are a total of nine weapons. Each of them has a different name and weight. RoomsThe game board represents the blueprints of the mansion and features fifteen different rooms. Each room will only have a name. Iteration 2: Create the mysteryAt the beginning of the game, players shuffle each of the card stacks to create a combination of suspect, weapon and room. This will be the mystery to solve. Random selectorDeclare a function named Create the mysteryDeclare a function named Iteration 3: Reveal the mysteryAt last, we are ready to reveal the mystery. Declare a function named <FIRST NAME> <LAST NAME> killed Mr. Boddy using the <WEAPON> in the <ROOM>! Test Your CodeWe will be working with automated tests again! Please, open your terminal, change directories into the root of the lab, and run Hint: $ cd lab-javascript-clue
$ npm install
$ npm run test:watch The test requirements ( Extra ResourcesHappy coding! |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论