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
15 changes: 15 additions & 0 deletions solutions/julia/annalyns-infiltration/1/annalyns-infiltration.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
function can_do_fast_attack(knight_awake)
return !knight_awake
end

function can_spy(knight_awake, archer_awake, prisoner_awake)
return knight_awake || archer_awake || prisoner_awake
end

function can_signal_prisoner(archer_awake, prisoner_awake)
return !archer_awake && prisoner_awake
end

function can_free_prisoner(knight_awake, archer_awake, prisoner_awake, dog_present)
return (dog_present && !archer_awake) || (prisoner_awake && !archer_awake && !knight_awake)
end