Zadziałało ale nie jestem pewien czy to dobre rozwiązanie - raczej powinien dookoła przejść

Widziałem podobne rozwiązanie w necie ale poszedł dołem


// Move to the wizard and get their secret values.
hero.moveXY(20, 24);
var secretA = hero.findNearestFriend().getSecretA();
var secretB = hero.findNearestFriend().getSecretB();
var secretC = hero.findNearestFriend().getSecretC();

// If ALL three values are true, take the high path.
// Otherwise, take the low path. Save the 4th value.
var secretD = secretA && secretB && secretC;
if (secretD)

// Sneak through the forest and ambush the shaman.
// Listen to 'Commander Craig' for warning of approaching enemy.

// Place flags after pressing Submit.
while(true) {
    var flag = hero.findFlag();
    var enemy = hero.findNearestEnemy();
    if (flag){
        // Pick the flag up.

CLEAVE okazało się niepotrzebne - trzeba zmienić bohatera na ŁUCZNIKA


// Nadchodzi armia ogrów. Użyj flag by wygrać bitwę !
while(true) {
    var flag = hero.findFlag();
    var enemy = hero.findNearestEnemy();
    if (flag){
    } else if (enemy){

<!-- The 'toggleClass' jQuery function turns on/off... -->
<!-- ... classes whether or not the class is off/on. -->

    var image = $("img");
    var header = $("h1");
    function toggleExpand() {
        // Toggle class "expand" on the 'h1' tag by using the header variable we just created

<!-- It is possible to find which element was selected. -->
<!-- Using $(this) in an event function does just that. -->
<!-- var elm = $(this) sets elm to the clicked element. -->

    li = $("li");
    function toggleStriked() {
    li.on("click", toggleStriked);
    h2 = $("h2"); // This sets h2 to all h2 elements.
    function toggleBold() {
        // $() also accepts 'this' as an argument.
        // 'this', when inside of an event function is...
        // ... the specific target for the event!
        // Look at "toggleStriked" for an example.
        // Toggle the class "bold" on the clicked h2:
    // When any h2 is clicked, perform "toggleBold".
    h2.on("click", toggleBold);
    .bold {
    .striked {

<!-- To select neighboring elements, use "siblings()" -->
<!-- Use this to unfocus elements next to a target. -->
<!-- Elements are neighbors when at similar identation. -->

    var selectable = $(".selectable");
    function focusSelected() {
        var targetElement = $(this);
        var siblings = targetElement.siblings();
        // Use removeClass() to remove "sel" from siblings.
        // Use addClass() to add "sel" to targetElement.
    selectable.on("click", focusSelected);
    .selectable {
        /* This makes the element transparent. */
        cursor: pointer;
    .sel {
    .mute {
        /* This makes the element transparent. */
    body {