Ritual of Rectangling - Adventurer Feedback

Hm, could you tell me more about it?

Not sure that I got it.

Yeah, I think it’s a good idea.

2 Likes

Thank you very much! Sorry, I saw it and accepted it, but I always forget that I need to “save” a level after accepting. I was sure if I accept it, then it’s enough.

2 Likes

Thanks. Fixed.

It’s a good idea. I change it. Could you check it?

2 Likes

Using the fire-trap method, the use of many fire-traps will send the Ogre flying around the map but with his shadow visible as it moves around the map, if this shadow touches the player, the player will die. I don’t know if this shadow “attack” will always kill you or its because I have low health after I got hit by the Ogre once.

2 Likes

O_O

It’s really really really weird. Could you post you code (or slack)? I will try to find what is happening.

1 Like

Here is my winning code: (I’m sorry, but I really forgot how to format it on discourse)

loop:
hero.buildXY(“fire-trap”, 16, 13)
if hero.health < 727:
hero.moveXY(3, 8)

If you change the hero.moveXY to (4,8) you will see what I mean.

1 Like

Thanks. I asked to restrict “hammers” for that level.

2 Likes

Hello everyone,
My code does not seem to be working. I think it is correct, but if it is not, could you let me know? I think there might be a bug with this level.

Code Below:

def almostEqual(valueA, valueB):
if valueA > 0.97 * valueB and valueA < 1.03 * valueB:
return valueA == valueB

def perimeter(side1, side2):

return 2 * (side1 + side2)

def area(side1, side2):

return side1 * side2

requiredPerimeter = 104
requiredArea = 660

base = hero.findNearest(hero.findFriends())

while True:
sideSN = base.distanceTo(“Femae”)
sideWE = base.distanceTo(“Illumina”)
currentPerimeter = perimeter(sideSN, sideWE)
currentArea = area(sideSN, sideWE)
if almostEqual(currentArea, requiredArea) and almostEqual(currentPerimeter, requiredPerimeter):
hero.say(“VENITE!”)
break

1 Like

Sorry if my code is not well formated, because I am new to this.

1 Like

So read this first: FAQ

1 Like

@John_Lang just taking a quick look try adding a hero.say() here in the code. Ask yourself what the statement will be in each case.

def almostEqual(valueA, valueB):
    if valueA > 0.97 * valueB and valueA < 1.03 * valueB:
        hero.say( valueA == valueB )
        return valueA == valueB
1 Like

I got it. However, the source code is wrong.

# We must summon the Ancient Warrior for this ogre!
# Four paladins must form a rectangle.
# But the rectangle needs a specific area and perimeter
# Paladins will keep moving, say the spell when ready.
# It is hard to be precise, but almost equal is good.


# This function should compare valueA and B within 3%.
def almostEqual(valueA, valueB):
    # Check if valueA is > 0.97 and < 1.03 of valueB.
    
    # As a default, just check equality.
    return valueA == valueB

# This function should calculate the perimeter:
def perimeter(side1, side2):
    # The perimeter is the sum of all four sides.
    
    pass

# This function should return the area:
def area(side1, side2):
    # The area of a rectangle is the product of 2 sides
    
    pass

# Required summoning values for area and perimeter:
requiredPerimeter = 104
requiredArea = 660

# We will use this unit as a base for our calculations:
base = hero.findNearest(hero.findFriends())

while True:
    sideSN = base.distanceTo("Femae")
    sideWE = base.distanceTo("Illumina")
    currentPerimeter = perimeter(sideSN, sideWE)
    currentArea = area(sideSN, sideWE)
    if almostEqual(currentArea, requiredArea) and almostEqual(currentPerimeter, requiredPerimeter):
        hero.say("VENITE!")
        break

The"return valueA == valueB" needs to be changed to “return True”.
Thanks,

2 Likes

He’s not wrong, returning an “==” value, in a function checking for approximation is returning a False value. Not sure if this was deliberate to catch people sleeping… :smile:

1 Like

Interesting… Anyways, thanks!

1 Like

This doesn’t have anything much to do with the code, but I think I might be experiencing glitches or something.
Before the enemy dies -

Nothing odd-looking so far, but…

After the enemy dies -

Then the enemy somehow appears to be underneath the bones on the ground, almost like part of an animated background (in my opinion) when he dies; is this intended?

Great level, by the way. I loved it.

1 Like

Hmmm, maybe because of bad graphic designs? Tell @Serg about this.

2 Likes

I wonder if this is an issue with all enlarged thangs because I also see this in The Trials.

1 Like

It’s a “problem” with layers. All dead bodies get lower layer priority, otherwise they will “hide” other “alive” objects.
I will think how to solve it for this level. Thanks!

2 Likes

Maybe you could adjust the z axis in css to raise it higher?

1 Like

Nope, layers are not the same as height. Don’t worry, I will fix it

2 Likes