2 kyu

Wumpus world

68 of 105FArekkusu
Description
Loading description...
Artificial Intelligence
Algorithms
Game Solvers
  • Please sign in or sign up to leave a comment.
  • Persa Avatar

    Very Very Enjoyable Kata, i enjoyed i a lot while solving, but i think it should be ranked as 1.

  • TheLittlePixiesFriend Avatar

    This comment has been hidden.

  • Cyclon4EG Avatar

    How it can be False?

            [*"____"],
            [*"___P"],
            [*"____"],
            [*"_PWG"]
    
  • quedo Avatar

    I fail to understand how this one could be True:
    _ _ _ _
    _ P _ _
    _ _ _ _
    _ W _ G

    The agent feels the wind in (0,1) and (1,0), but pits could be at (2,0) and (0,2).

  • typeError92 Avatar

    Great kata!

    Just to clarify, what exactly is meant by the agent "finding" the gold? Have they found the gold a) once they know where it is or b) once they've entered that room?

    (As can easily be seen from this example

    [[*"___W"],
     [*"____"],
     [*"__PP"],
     [*"__PG"]]
    

    it may be possible to do a) but not b).)

  • MemoriesWholesale Avatar

    Does the Wumpus cease to emit its odor once slain?

  • Daniel-CG-Wright Avatar
    [*"__W_"],
    [*"____"],
    [*"_PPP"],
    [*"___G"]
    

    I'm not sure I understand how this is false. The kata is very interesting, but I don't understand this one case. Here is my understanding so far: if you know there are 3 pits, you can safely move to 0,1 where you smell wumpus, 1,0, 1,1 where you get wind from a pit, but then you don't know if that pit is 1,2 so cannot move to 1,2 to smell wumpus again and kill him. You can also move to 2,0, where you can get wind from another pit, but as you know there are 3 pits, you cannot be sure that the wind is coming from a pit at 2,1 (when mixed with the wind from 1,1) - it could be pits at 1,2 and 3,0, so you cannot safely move from 2,0. How do you get enough information to get the gold?

  • me4iniy Avatar

    Looks like a mistake

    ____
    ___P
    P_PG
    _W__
    

    Expected: False

  • MarekMas Avatar

    Does Agent know that the cave is 4x4 and his start position is 0,0?

  • dfhwze Avatar
  • dfhwze Avatar
  • Mirras Avatar

    Hey guys, can someone give me a hint on this one? I've been trying it for quite some time. I'm using a BFS, but at this point I'm not quite sure if this is a good approach. A DFS would be any better?

    Edit: scrolling down I saw my old post, from 6 months ago, hahah wow

  • dfhwze Avatar
    • Julia translation approved (author depial)
    • Java translation approved (author koba1996)
  • Blind4Basics Avatar

    I fail to see how this one is True

    ____
    _P__
    W_P_
    ___G
    
    1. kill W
    2. identify 1,1 as a pit
    3. ...? There is no way to distinguish this one from that one, afaik:
    ____
    _P__
    W_G_
    ___P
    

    EDIT: I'm starting to wonder if I didn't forget to update properly the expected output, so surely they actually expect False...?

  • Blind4Basics Avatar

    the random tests must be splitted into smaller batches (more of them)... I'm currently facing this:

    1 pit
    (500 of 500 Assertions)
    2 pits
    (999 of 1000 Assertions)
    3 pits
    (1999 of 2000 Assertions) 
    

    And I cannot FU..ING FIND the failing tests because the output panel isn't showing the whole console, now that kazk made it "lazy loaded"... x/

  • Davo36 Avatar

    What an excellent kata! For the life of me I can't see why this test is true:

        [*"__GP"],
        [*"_P__"],
        [*"W___"],
        [*"____"]
    

    You can move to squares (0,1) and (1,0) but you can't tell anything after that can you?

    At (1,0) you smell the wumpus and feel the wind of a bottomless pit. But you don't know which is which - so you can't do anything.

    At (0,1) you feel the wind of a bottomless pit. But again, you don't know whether it's down or right - so you can't move any further.

    And you can't use the knowledge that both of those squares feel windy, because there could be pits at (0,2) and (2,0). With the wumpus at (1,1).

    A hint would be appreciated :)

  • seniorCrutchDeveloper Avatar

    There is a problem with the tests and this needs to be corrected, such as this card:

    ___W
    ____
    P__P
    _G_P
    True should equal False
    

    I move down first.

    V__W
    ____
    P__P
    _G_P
    
    V__W
    V___
    P__P
    _G_P
    

    The pit could probably be in the dots: (2, 0); (1, 1). Then I start moving like this:

    VV_W
    V___
    P__P
    _G_P
    
    VV_W
    VV__
    P__P
    _G_P
    
    VV_W
    VV__
    PV_P
    _G_P
    

    The pit can be at points: (2,0); (2,2); (3,1).But now I know that the point (1,1) is beyond suspicion, because I visited it from the point (0,1). Consequently, I can try again to go from the point (1,0) and now I can definitely say that the pit is at the point (2,0). After that I mark that (2,0) is the pit and pass to the gold. Since I can now feel no wind at (2,1)!

  • koba1996 Avatar

    I had a lot of fun while completing this kata, thank you! I also created a java translation, please review and accept, if you are satisfied with it. Thanks again!

  • Mihail_Onuchin Avatar

    Awesome kata! 👍

  • Mirras Avatar

    -P--
    -W--
    --G-
    ----


    -P--
    ----
    ----
    -GW-

    Could someone please explain to me why these should be false? Can't the agent get to the gold safely?

  • Unnamed Avatar
    __PW
    ____
    __P_
    P__G
    True should equal False
    

    Looks true to me OK, it's false.

  • Kacarott Avatar

    The first sample test breaks the rule that there will always be 1-3 pits.

  • dfhwze Avatar

    Excellent kata, I had much fun! At least 3 kyu in my book.

  • dfhwze Avatar

    3 pits still buggy:

    Random test case expects False, but is True

    cave = [
        [*"__PG"],
        [*"___W"],
        [*"__PP"],
        [*"____"]
    ]
    
    • pits at (0,2) and (2,2) can be spotted first
    • W can be spotted after
    • pit (2,3) can then be spotted with the same intersection rule that was buggy with 1 and 2 pits test cases

    if you need more details about the pathing, let me know

  • dfhwze Avatar

    Why so many random tests? Is it meant to be a performance kata (tag needed), or are you hoping for sufficient variation in edge cases this way (perhaps a smart/biased random test generator should be provided, if feasible)? I'll log as issue, as either way, action should be taken.

  • dfhwze Avatar

    Random test case expects False while it should be True:

    cave = [
      [*"__P_"],
      [*"____"],
      [*"WP__"],
      [*"_G__"]
            ]
    
    • (0,0) -> move down: W can be on (2,0) and (1,1)
    • (0,0) -> move right: W can't be on previously candidate (1,1), so it has to be on (2,0). We can kill it and claim its place.
    • (1,0) -> prevents a P on (1,1) so we can move to it.
    • (0,1) -> only possible option for P is on (0,2). Only 1 more pit remaining.
    • (1,1) -> possible last P on (2,1) or (1,2).
    • (2,0) -> possible last P on (2,1) or (3,0).
    • since only 1 P remaining, it has to be in intersection of P candidates of above last 2 lines -> [(2,1),(1,2)] intersect [(2,1),(3,0)] is (2,1).
    • both P and W are found, a passage is possible to G.
  • dfhwze Avatar

    One sample test is bugging me:

    [*"__GP"],
    [*"_P__"],
    [*"W___"],
    [*"____"]
    

    I can take a step down, sensors for W and P go off. I can take a step right, sensor for P goes off. Since there are two pits and no location for W or any of the P can be determined (or can it?), what next move is there to make?

  • dfhwze Avatar

    Does the wind sensor measure intensity? In other words, does the agent know how many neighbouring pits there are for a given cell (when the sensor measures something), or just there is at least one?

  • scarecrw Avatar

    Am I missing something about why the second test case is false?

    _ _ _ _
    _ P _ _
    _ _ _ _
    _ W _ G
    

    It seems to me that the agent could move to (0, 1) and (1, 0) safely, and then, knowing that there's only one pit, determine that (0, 2) is safe (and from there progress to the goal).

  • user3460148 Avatar

    Reference solution fails for

    [['_', '_', 'P', 'G'], 
     ['_', '_', 'P', '_'], 
     ['_', '_', '_', '_'], 
     ['_', 'P', 'W', '_']]
    

    Actual result = True, Reference solution result: False
    True/real pit locations, in this test case, can be inferred from wind signature and number of pits.