Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validating nested loops #334

Open
alecmolloy opened this issue Aug 31, 2016 · 0 comments
Open

Validating nested loops #334

alecmolloy opened this issue Aug 31, 2016 · 0 comments

Comments

@alecmolloy
Copy link
Contributor

alecmolloy commented Aug 31, 2016

An issue as old as time, but still is wreaking havoc on some cool challenges i've been trying to do.

This validates totally fine:

{
    "id": "pattern",
    "title": "Pattern",
    "description": "Learn about color interactions and how shapes can affect our perception of color",
    "code": "",
    "startAt": 2,
    "steps": [
        {
            "hint": "",
            "solution": "for r in [0 .. 350] by 50"
        },
        {
            "hint": "",
            "solution": "    offset = random 0, 1, true"
        },
        {
            "hint": "",
            "solution": "    for i in [0 ... 2] by .1"
        },
        {
            "hint": "",
            "solution": "        arc r, i, i - .05",
        }
    ],
    "completion_text": "",
    "cover": "ozwaldboateng/pattern.png"
}

This does not:

{
    "id": "pattern",
    "title": "Pattern",
    "description": "Learn about color interactions and how shapes can affect our perception of color",
    "code": "",
    "startAt": 2,
    "steps": [
        {
            "hint": "",
            "solution": "for r in [0 .. 350] by 50"
        },
        {
            "hint": "",
            "solution": "    offset = random 0, 1, true"
        },
        {
            "hint": "",
            "solution": "    for i in [0 ... 2] by .1"
        },
        {
            "hint": "",
            "solution": "        arc r, i + offset, i - .05 + offset"
        }
    ],
    "completion_text": "",
    "cover": "ozwaldboateng/pattern.png"
}

The only difference between the two above JSON files is the inclusion of extra binary operators in the second example (adding an offset). Doing so in a nested loop reliably breaks validation for no clear reason.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant