Skip to content

PT_RMT_012025 Richard Nixon #3702

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
166 changes: 160 additions & 6 deletions src/clue.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,179 @@

// Suspects Array

const suspectsArray = [];
const suspectsArray = [
{
firstName: 'Jacob',
lastName: 'Green',
occupation: 'Entrepreneur',
age: 25,
description: 'A business-minded individual with a sharp mind, always thinking of new ventures.',
image: 'jacob_green.png',
color: 'Green'
},
{
firstName: 'Sarah',
lastName: 'Blue',
occupation: 'Artist',
age: 32,
description: 'A creative soul, constantly working on new projects and paintings.',
image: 'sarah_blue.png',
color: 'Blue'
},
{
firstName: 'Ethan',
lastName: 'Black',
occupation: 'Scientist',
age: 45,
description: 'An analytical and methodical thinker, always focused on his experiments.',
image: 'ethan_black.png',
color: 'Black'
},
{
firstName: 'Maria',
lastName: 'White',
occupation: 'Teacher',
age: 38,
description: 'A kind and patient person, known for her dedication to her students.',
image: 'maria_white.png',
color: 'White'
},
{
firstName: 'Oscar',
lastName: 'Gray',
occupation: 'Lawyer',
age: 50,
description: 'A sharp-minded attorney who always has an answer for everything.',
image: 'oscar_gray.png',
color: 'Gray'
},
{
firstName: 'Lena',
lastName: 'Yellow',
occupation: 'Journalist',
age: 29,
description: 'An inquisitive and courageous journalist, always on the hunt for a good story.',
image: 'lena_yellow.png',
color: 'Yellow'
}

];

// Rooms Array

const roomsArray = [];
const roomsArray = [
{
name: 'Library'
},
{
name: 'Kitchen'
},
{
name: 'Dining Room'
},
{
name: 'Ballroom'
},
{
name: 'Parlor'
},
{
name: 'Study'
},
{
name: 'Master Bedroom'
},
{
name: 'Guest Bedroom'
},
{
name: 'Bathroom'
},
{
name: 'Hallway'
},
{
name: 'Gallery'
},
{
name: 'Conservatory'
},
{
name: 'Cellar'
},
{
name: 'Garage'
},
{
name: 'Attic'
}
];

// Weapons Array

const weaponsArray = [];
const weaponsArray = [
{
name: 'Shotgun',
weight: 4
},
{
name: 'Revolver',
weight: 2
},
{
name: 'Sledgehammer',
weight: 5
},
{
name: 'Hammer',
weight: 1
},
{
name: 'Rope',
weight: 1
},
{
name: 'Shovel',
weight: 2
},
{
name: 'Crossbow',
weight: 3
},
{
name: 'Crowbar',
weight: 3
},
{
name: 'Chainsaw',
weight: 5
}

];


// ITERATION 2

function selectRandom() {}
function selectRandom(arr) {
let randomCards = arr[Math.floor(Math.random() * arr.length)];
return randomCards;
}

function pickMystery() {
return {
suspect: selectRandom(suspectsArray) ,
weapon: selectRandom(weaponsArray) ,
room: selectRandom(roomsArray)
};
}

function pickMystery() {}


// ITERATION 3

function revealMystery() {}
function revealMystery(envelope) {
return `${envelope.suspect.firstName} ${envelope.suspect.lastName} killed Mr. Boddy using the ${envelope.weapon.name} in the ${envelope.room.name}!`;
}

const envelope = pickMystery();
console.log(revealMystery(envelope));