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

Control flow #7

Open
bencochran opened this issue Nov 12, 2015 · 0 comments
Open

Control flow #7

bencochran opened this issue Nov 12, 2015 · 0 comments

Comments

@bencochran
Copy link
Owner

As seen in chapter 5:

  • if/then/else

    def fib(x)
      if x < 3 then
        1
      else
        fib(x-1)+fib(x-2);
    
  • for

    extern putchard(char);
    def printstar(n)
      for i = 1, i < n, 1.0 in
        putchard(42);  # ascii 42 = '*'
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant