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

LogoWorks: Challenging programs in Logo (versions adapted for ITS hosted LOGOs) #1538

Open
1 of 7 tasks
Alexey-Slyusar opened this issue Feb 17, 2019 · 3 comments
Open
1 of 7 tasks

Comments

@Alexey-Slyusar
Copy link
Contributor

Alexey-Slyusar commented Feb 17, 2019

"The best way to understanding is a few good examples."
Isaac Newton

This issue is created to discuss interesting piece of Logo code created / adapted for ITS hosted versions of LOGO in some depth.

Here is a current list of programs:

  • A LLOGO version of the Logo Adventure game written by Don Hopkins.
    We have it ported already. To load code in interpretive mode, type in LLOGO prompt:
    ?RF ADV LOGO DSK A2DEH
  • A Logo Interpreter in LLOGO.
    It is based on Jim Davis and Ed Hardebeck logo code.
    An early version of this code initially was written by Henry Minsky.
  • A BASIC Compiler in LLOGO.
    It is based on logo code by Brian Harvey.
  • A LLOGO version for Eliza program written in 1966 by Joseph Weizenbaum at MIT.
    It is based on logo code by Brian Harvey.
  • A LLOGO version of Student, a program written by Daniel G. Bobrow for his 1964 Ph.D. thesis,
    Natural Language Input for a Computer Problem Solving System, at MIT.
    It is based on logo version of the program written by Brian Harvey.
  • A CLOGO version of well-known Animal Game.
    It is based on logo code by William Wenreb.
  • A LLOGO version of Tic-Tac-Toe game.
    It is based on code by Brian Harvey and shows the way how we can completely avoid recursion or
    any other repeating mechanism in relatively large project by using Higher-order functions. is some kind of APL way of thinking in a language that belongs to Lisp family. ;-)

I will add the code to the main ITS repository as it is ready for running on ITS hosted LOGO versions.

I believe that this list should be enhanced with more examples of interesting logo code.
It is a plaything and a work in progress.

@Alexey-Slyusar Alexey-Slyusar changed the title LogoWorks: Challenging programs in Logo (versions adapted for ITS hosted LOGO versions) LogoWorks: Challenging programs in Logo (versions adapted for ITS hosted LOGOs) Feb 17, 2019
@Alexey-Slyusar
Copy link
Contributor Author

Alexey-Slyusar commented Mar 1, 2019

Before discussing relatively sizeable projects listed above, I want to show a short but complete program here.

If you think Logo is just a graphics language for little kids, please take a look at the following program that should impress you.

Here is the program in LLOGO:

?RF CHOICES >
;READING CHOICES > DSK ALEXEY
; CHOICES BY BRIAN HARVEY
TO CHOICES :MENU :SOFAR
10 IF EMPTYP :MENU PRINT :SOFAR STOP
20 FOREACH FIRST :MENU [(CHOICES BF :MENU SE :SOFAR ?)]
END
;CHOICES DEFINED

And here is how you use it.

You type:

?CHOICES [[SMALL MEDIUM LARGE][VANILLA [ULTRA CHOCOLATE] LYCHEE [RUM RAISIN] GINGER][CONE CUP]] []

and LLOGO replies:

SMALL VANILLA CONE
SMALL VANILLA CUP
SMALL ULTRA CHOCOLATE CONE
SMALL ULTRA CHOCOLATE CUP
SMALL LYCHEE CONE
SMALL LYCHEE CUP
SMALL RUM RAISIN CONE
SMALL RUM RAISIN CUP
SMALL GINGER CONE
SMALL GINGER CUP
MEDIUM VANILLA CONE
MEDIUM VANILLA CUP
MEDIUM ULTRA CHOCOLATE CONE
MEDIUM ULTRA CHOCOLATE CUP
MEDIUM LYCHEE CONE
MEDIUM LYCHEE CUP
MEDIUM RUM RAISIN CONE
MEDIUM RUM RAISIN CUP
MEDIUM GINGER CONE
MEDIUM GINGER CUP
LARGE VANILLA CONE
LARGE VANILLA CUP
LARGE ULTRA CHOCOLATE CONE
LARGE ULTRA CHOCOLATE CUP
LARGE LYCHEE CONE
LARGE LYCHEE CUP
LARGE RUM RAISIN CONE
LARGE RUM RAISIN CUP
LARGE GINGER CONE
LARGE GINGER CUP
?

The program written by Dr. Brian Harvey, I just wrote FOREACH routine and did a minor modification to get code running in LLOGO.

To quote the author here: "The program doesn't have anything about the size of the menu built in. You can use any number of categories, and any number of possibilities in each category. Let's see you do that in four lines of Java!"

Here is a link for the original program:
https://people.eecs.berkeley.edu/~bh/logo-sample.html

@Alexey-Slyusar
Copy link
Contributor Author

Lars, could you please suggest a directory name for such code as discussed here. I am pretty sure that every person mentioned above historically had a directory on ITS. But possibly to put all the discussed code into one directory is better idea?

@larsbrinkhoff
Copy link
Member

Brian Harvey's program could be in BH, because that used to be his directory.

In general, LOGO might be ok.

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

2 participants