Skip to content
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
20 changes: 19 additions & 1 deletion main.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,29 @@ const getRandomInt = (min, max) => {
}

const generateHint = () => {
for (let i=0; i < solution.length; i++) {
if (answer[i] == solution[i]) {

solution[i] = "matched";
answer[i] = "check";
}
}
// your code here
}

const mastermind = (guess) => {
solution = 'abcd'; // Comment this out to generate a random solution

pick1 = colors[Math.floor(Math.random() * 8)];
pick2 = colors[Math.floor(Math.random() * 8)];
pick3= colors[Math.floor(Math.random() * 8)];
pick4 = colors[Math.floor(Math.random() * 8)];

answer = [pick1, pick1, pick3, pick4];
console.log(answer);




// your code here
}

Expand Down