Git Product home page Git Product logo

Comments (2)

deepakjois avatar deepakjois commented on September 24, 2024

This depends on some refactoring as part of #40. Will defer until then.

from hs-logo.

deepakjois avatar deepakjois commented on September 24, 2024

Here is an example of an interesting way to call the for library procedure taken from the Logo 15-word challenge.

for [i 0 220 sin :i/1000] [fd :i bk :i rt 41]

One interesting thing about the statement above is that the value :i/1000 evaluates to 0 and hence the program should go into an infinite loop. It is unclear how it generates the figure as shown on the page.

Moreover, this is in violation of the the Berkeley Logo spec for the for library procedure:

FOR forcontrol instructionlist

The first input must be a list containing three or four members: (1) a word, which will be used as the name of a local variable; (2) a word or list that will be evaluated as by RUN to determine a number, the starting value of the variable; (3) a word or list that will be evaluated to determine a number, the limit value of the variable; (4) an optional word or list that will be evaluated to determine the step size. If the fourth member is missing, the step size will be 1 or –1 depending on whether the limit value is greater than or less than the starting value, respectively.

The best way to resolve this seems to be to obey the spec, and modify the statement above appropriately.

for [i 0 220 [sin :i/1000]] [fd :i bk :i rt 41]

However the problem of infinite looping remains.

from hs-logo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.