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
37 changes: 28 additions & 9 deletions 3.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,39 @@
export function canExecuteFastAttack(knightIsAwake) {

}

var knightIsAwake = false;
var archerIsAwake = true;
var prisonerIsAwake = false;
export function canSpy(knightIsAwake, archerIsAwake, prisonerIsAwake) {

return knightIsAwake || archerIsAwake || prisonerIsAwake;
}

/**
* You'll get caught by the archer if you signal while they're awake.
*
* @param {boolean} archerIsAwake
* @param {boolean} prisonerIsAwake
*
* @returns {boolean} Whether or not you can send a signal to the prisoner.
*/
var archerIsAwake = false;
var prisonerIsAwake = true;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Look at line 16 here. It's supposed be true not false

export function canSignalPrisoner(archerIsAwake, prisonerIsAwake) {

return prisonerIsAwake && !archerIsAwake;
}

export function canFreePrisoner(
/**
* The final stage in the plan: freeing Annalyn's best friend.
*
* @param {boolean} knightIsAwake
* @param {boolean} archerIsAwake
* @param {boolean} prisonerIsAwake
* @param {boolean} petDogIsPresent
*
* @returns {boolean} Whether or not you can free Annalyn's friend.
*/
export function canFreePrisoner(
knightIsAwake,
archerIsAwake,
prisonerIsAwake,
petDogIsPresent
) {

) {
return (!archerIsAwake && petDogIsPresent) || (prisonerIsAwake && !archerIsAwake && !knightIsAwake);
}