-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
58 lines (52 loc) · 1.35 KB
/
index.js
File metadata and controls
58 lines (52 loc) · 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/**
* Other considerations
* - How will we keep track of score?
* - How will we keep track of streaks?
* - How will we keep track of retries?
*
* Other functions
* - Increment score
* - Decrement score
* - Make guess
*/
/**
* @typedef {Object} Person
* @property {string} id
* @property {string} firstName
* @property {string} lastName
* @property {Object} headshot
* @property {string} headshot.url
*/
/**
* Some things we want to keep track of:
* - Who the correct person is
* - Who has been incorrectly guessed
* @typedef {Object} Game
*/
/** @type {Person[]]} */
const ALL_PEOPLE = require('./data.json')
/**
* Given a list of Person objects, listOfPeople, return an array of
* randomly selected Persons whose length is no larger than numberToReturn.
*
* @param {Person[]} listOfPeople
* @param {number} numberToReturn
* @returns {Person[]}
*/
function getRandomPeople(listOfPeople, numberToReturn) {}
/**
* Given a list of Persons, create a Game object which
* you can decide how it is shaped.
*
* @param {Person[]} listOfPeople
* @returns {Game}
*/
function makeGame(listOfPeople) {}
/**
* Given the selected person the user is guessing and the game,
* return if the selected person is the correct answer.
* @param {Person} selectedPerson
* @param {Game} game
* @returns {boolean}
*/
function isGuessCorrect(selectedPerson, game) {}