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

Loops #5

Open
SK1Y101 opened this issue Jul 5, 2021 · 1 comment
Open

Loops #5

SK1Y101 opened this issue Jul 5, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@SK1Y101
Copy link
Member

SK1Y101 commented Jul 5, 2021

Som syntax ideas for loops:

For loops

Python:

for x in range(10):
    print(x)

This language:

Start a counter at zero, and repeat the following ten times:
    show the counter

While

Python:

while true:
    print(“loops up”)

This language:

repeat the following forever:
    Show loops up

break

Python:

while true:
  if x == true:
    break

This language:

repeat the following forever:
    if the value of x is true, then:
        stop the loop

Not sure whether any of these are readable, but that’s for discussion to decide right?

@SK1Y101 SK1Y101 added the enhancement New feature or request label Jul 5, 2021
@SK1Y101 SK1Y101 added this to the Full Language Syntax milestone Jul 5, 2021
@SK1Y101 SK1Y101 mentioned this issue Jul 5, 2021
14 tasks
@SK1Y101
Copy link
Member Author

SK1Y101 commented Jul 7, 2021

The slightly less well known equivalent of while, until instead continues executing while the condition is false:

(modern languages like python and C do not have a direct anaglogue)

while x != 2:
  print(x)

verboscript:

repeat the following until x is equal to two:
  show x.

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

No branches or pull requests

1 participant