Skip to content

Convert to indentation-based blocks #6

Description

@avborup

Much like Python.

Currently, we have:

i = -1;
while (i = i + 1) < n {
  j = i;
  while (j = j + 1) < n {
    part1 = rep[i] * rep[j] if rep[i] + rep[j] == 2020;

    k = j;
    while (k = k + 1) < n {
      part2 = rep[i] * rep[j] * rep[k] if rep[i] + rep[j] + rep[k] == 2020;
    };
  };
};

But it should become the following (no curly braces, no required semicolons):

i = -1
while (i = i + 1) < n:
    j = i
    while (j = j + 1) < n:
        part1 = rep[i] * rep[j] if rep[i] + rep[j] == 2020

        k = j
        while (k = k + 1) < n:
            part2 = rep[i] * rep[j] * rep[k] if rep[i] + rep[j] + rep[k] == 2020

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions