Look past it code combat junior help needed

hey so my 8 year old kid is stuck in this ''look past it" level and like other times I’m trying to help.

The main problem I notice is the lack of documentation or help on the UI.
For example he is suppose to use the function look(‘up’) which is not use unless you combine it with a variable so the conditional makes sense .i.e.: look('up') == ''gem"'
However nowhere in the UI explains that the gem variable its spelled like that I had to google for a while, the same for the ‘enemy’.

TLDR sounds like with the tools the level gives its impossible to finish in time since the look function only works for close enemies, can anyone share a light on how to check to far away enemies?

Hi @rowdy welcome to the discourse! Could you post the level link please?

1 Like

CodeCombat - Coding games to learn Python and JavaScript?

1 Like

I’m not familiar with CoCo Junior but looking at the level editor, it looks like the level gives you these functions to work with to find enemies:


Could that work?

hi!, here it is
CodeCombat - Coding games to learn Python and JavaScript?

ok this is my point about lack of docs, how did you reach to that API? I was not able to, and certainly my 8 year old won’t be able to :frowning:

Actually, you don’t need findNearestEnemy() for this level (although it would make sense)
just copying the second block of “left side” code (with the two zaps and the one hit) and changing it to be targeted towards the right side will work

so by zapping twice and hitting (because I can’t save hits as I can’t see enemies) I waste time in areas where there is only gems. Yes the algorithm works, and should achieve all the objectives, but the execution does not finish as you run out of time.

basically losing with 1 second to finish which I could save by not attacking when no enemies

Thinking further if I could look for “sea” ? I could save hits, but, the game nowhere state the name of the variables. Sorry my rant its mainly as this is paid, and its suppose to be for young kids, UI needs a lot of work here…

1 Like

You don’t need to check if there is a gem or not
I just added on the original code a tiny bit and it works

for i in range(0, 5):
    if look('left'):
        go('left', 1)
        go('right', 1)
    if look('left'):
        zap('left')
        zap('left')
        hit('left')
    if look('right'):
        go('right', 1)
        go('left', 1)
    if look('right'):
        zap('right')
        zap('right')
        hit('right')
    
    go('down', 1)

The level is always the same

totally ok!

sadly you cannot see tile types for the most part
has your kid encountered a need for changing behavior based on what look() returns yet?

fair enough, that works thanks!
so basically running the same function twice look(''left'') will actually return true if there is an enemy 4 spaces away?? would be awesome to have more readable code where the if is actually meaningful, like real world…

1 Like

well my common sense was guiding me to point him that direction, using the conditional towards different values. Also the tooltip help on the function infers checking for different variables. Like “gem”

1 Like

oh I see. That is definitely a bit misleading then
that enemy’s type is “fly” btw