aroberge/reeborg

Another question about RUR...

abixadamj opened this issue · 2 comments

Dear @aroberge
In Hurdle world, there is a code in OnLoad:

"// The following is going to be called in the Post editor",
    "// we want users to be able to use either Python or Javascript",
    "// to solve this task - so we cannot have Python or Javascript",
    "// specific syntax in either the Pre or the Post editor",
    "RUR.public.my_check = function (failure) {",
    "    if ( RUR.check_path(RUR.public['path']) ) {",
    "        return; // nothing else required.",
    "    }",
    "",

Is there something like RUR.check_intems_in_robot ? Something, which will return values like carries_object() in Python?
I want to make a World in which I put random apples and want to check if all apples will be taken by user.

I can't think of an easy function to use for this purpose. However, it is not needed.

If you look at https://reeborg.ca/reeborg.html?lang=en&mode=python&menu=worlds%2Fmenus%2Freeborg_intro_en.json&name=Around%201%20-%20apple&url=worlds%2Ftutorial_en%2Faround1c.json, you will see that it is such a world.

What you need is to create a world that has at least one goal (say, having Reeborg go to a specific location), but that is otherwise empty. Then, in the OnLoad editor, you add the apples randomly. Since the world has been created with a goal that does not include any apples, it will automatically check at the end to ensure that the apples have all been picked up.