徽标编程语言实现

发布于 2024-07-24 23:43:24 字数 1542 浏览 9 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(12

大海や 2024-07-31 23:43:26

您可以使用http://www.logointerpreter.com。 它是一个使用 HTML5 和 JQuery 的基于 Web 的解释器。

You can use http://www.logointerpreter.com. It's a web based interpreter using HTML5 and JQuery.

风情万种。 2024-07-31 23:43:26

海龟学院在线是学习和实验标志的神源

Turtle academy online is a god source for learning and experimenting logo

青朷 2024-07-31 23:43:25

在 Mac 或 Linux 上启动终端,输入 python,然后按 Return 或 Enter。 然后输入 fromturtle import *,然后按 Return 或 Enter。 现在输入 fd(100),然后按 Return 或 Enter。 万岁! 标志与Python! =D(Windows 用户可以在此处安装 Python)

文档

有关完整的命令列表,请参阅在线文档。 请注意,文档会告诉您输入 turtle.fd(100),而不是 fd(100),因为他们选择使用 importturtle >,而不是 fromturtle import *。 星号方法几乎总是不好的,因为它可能会将您自己的函数与模块中的函数混淆,但在这种情况下它是好的,因为它允许我们使用适当的徽标命令来控制海龟。

保存徽标函数

创建一个名为 shapes.py 的文件,并将其保存在合适的位置。 将以下代码添加到 shapes.py 中:

from turtle import *

def square(size):
    for i in range(4):
        fd(100)
        rt(90)

def fun(size):
    for i in range (10):
        square (size)
        rt(36)

现在,每当您想要制作徽标时,请导航到在运行 python 之前保存 shapes.py 的位置。 然后,运行 python 后,运行 from Shapes import * 而不是 fromturtle import *。 这将导入徽标以及您在 shape.py 中定义的任何自定义函数。 因此,每当您创建一个很酷的函数时,只需将其保存在 shapes.py 中以供将来使用。

例如交互式会话(从相关目录运行python后):

from shapes import *

square(100)
fun(50)

Fire up a terminal on Mac or Linux, and type python, then press Return or Enter. Then type from turtle import *, then Return or Enter. Now type fd(100), then Return or Enter. Hooray! Logo with Python! =D (Windows users can install Python here)

Documentation

For a complete list of commands, see the online documentation. Note that the documentation will tell you to type turtle.fd(100), rather than fd(100), because they chose to use import turtle, rather than from turtle import *. The star method is almost always bad, because it makes it possible to confuse your own functions with those in the module, but in this case it is good, because it lets us control the turtle with proper logo commands.

Saving logo functions

Create a file called shapes.py, and save it somewhere sensible. Add the following code to shapes.py:

from turtle import *

def square(size):
    for i in range(4):
        fd(100)
        rt(90)

def fun(size):
    for i in range (10):
        square (size)
        rt(36)

Now, whenever you want to do logo, navigate to wherever you saved shapes.py before running python. Then, after running python, run from shapes import * instead of from turtle import *. This will import logo along with any custom functions you have defined in shapes.py. So, whenever you make a cool function, just save it in shapes.py for future use.

e.g. interactive session (after running python from the relevant directory):

from shapes import *

square(100)
fun(50)
兮颜 2024-07-31 23:43:25

UCBLogo 是我最喜欢的 LOGO 实现,并且恰好适用于 Windows、UNIX (X11 支持海龟绘图)和 Mac OS X,以及 DOS 和 Mac OS 9 的过时端口。

大多数 Linux 发行版已经 打包

它仍然得到维护(感谢伯克利的廉价劳动力学生)、开源且非常可移植(我已经在各种版本的 UNIX 上运行它,包括 Linux,以及各种处理器架构) )。

UCBLogo 附带了相当全面的标准库和良好的文档; 还包括 Brian Harvey 的“计算机科学徽标样式”书中示例的源代码。


附录:

papert - 浏览器中的徽标功能令人惊讶,并且似乎可以在任何现代浏览器中使用。

UCBLogo is my favorite LOGO implementation, and happens to be available for Windows, UNIX (with X11 support for turtle drawing), and Mac OS X, with outdated ports for DOS and Mac OS 9 as well.

Most Linux distros already have it packaged.

It is also still maintained (thanks to cheap labor students at Berkeley), open-source, and very portable (I've run it on various flavors of UNIX, including Linux, and various processor architectures as well).

UCBLogo comes with a fairly comprehensive standard library and good documentation; the source code for the examples in Brian Harvey's "Computer Science Logo Style" books are also included.


Addendum:

papert - logo in your browser is surprisingly featureful, and seems to work in any modern browser.

拒绝两难 2024-07-31 23:43:25

我正在使用 Elica LOGO 在 Windows 上成功教我的孩子 LOGO 。 (目前儿童年龄为 12 岁和 10 岁。)

该软件包的优点包括许多超出基本二维乌龟范围的“高级”扩展。 其中包括 3D 图形和 Windows 小部件世界的简单挂钩。 (您可以从 LOGO 代码中创建带有按钮等的 Windows 窗体。)

缺乏声音/音乐功能,至少在 5.5 版本中是这样,并且内置文档很丰富,有许多高级示例,但不是很有用在我看来——由于它的不完整性,并且它有许多包含错误的编码示例。 (但是我的孩子通过查找编程示例中的错误学到了更多知识。)

I'm teaching my kids LOGO successfully on Windows using Elica LOGO. (Kids ages are presently 12 and 10.)

The package's strengths include many "advanced" extensions, beyond the basic 2-dimensional turtle. These include 3-D graphics and simple hooks into the Windows widget world. (You can create Windows forms with buttons, etc., from within your LOGO code.)

Lacks sound/music capability, at least in version 5.5, and the built-in documentation is extensive, with many advanced examples, but it's not very useful in my opinion--due to its incompleteness, and its having many coding examples that contain errors. (But my kids learn more by finding the errors in the programing samples.)

屋檐 2024-07-31 23:43:25

KTurtle - http://edu.kde.org/applications/school/kturtle/是你在linux下需要的。

对于 Windows 版本的 kturtle,请访问 windows.kde.org

KTurtle - http://edu.kde.org/applications/school/kturtle/ is what you need under linux.

for windows version of kturtle visit windows.kde.org

‖放下 2024-07-31 23:43:25

现在教孩子们标志的最好方法是通过 TurtleAcademy http://turtleacademy.com
这是一个非常酷的网站,适合开始学习徽标原理,而且是免费的

The best way to teach kids logo now it through TurtleAcademy http://turtleacademy.com .
That's a really cool site for starting learning the logo principles and it's free

战皆罪 2024-07-31 23:43:25

为了真正重现怀旧之情,您可以尝试在模拟的 Apple II 上运行 Logo。 您可以在此处获取 Apple II 磁盘的徽标图像AppleWin 模拟器

To really recreate the nostalgia, you might try running Logo on an emulated Apple II. You can get images of Apple II disks for Logo here and the AppleWin emulator here.

此刻的回忆 2024-07-31 23:43:25

http://pylogo.org/ 提供了纯 Python 版本的 Logo

There is a pure-Python version of Logo available at http://pylogo.org/

淡淡の花香 2024-07-31 23:43:25

这是一个很好的免费 Windows 版本
http://www.softronix.com/logo.html

您可能会看到一个平行徽标看着
http://ccl.northwestern.edu/netlogo/

此外,麻省理工学院有一个很好的平行徽标,称为明星标志
http://education.mit.edu/starlogo/

Here's a good free one for windows
http://www.softronix.com/logo.html

And there's a parellel logo you might look at
http://ccl.northwestern.edu/netlogo/

Also, MIT has a good parallel logo called starlogo
http://education.mit.edu/starlogo/

翻了热茶 2024-07-31 23:43:25

http://tortue-logo.fr 是徽标语言的浏览器版本。 它是用 raphaeljs 用 javascript 开发的(服务器端使用 python/django,但解释器在客户端运行)。

它只能让你和乌龟玩耍成为可能,但它可能足以提醒你学习如何编程的美好时光。 :) 我认为它应该涵盖 LOGO 语言的主要命令。

目前支持法语和英语。 法语版本的 LOGO 与英语版本不同(命令被翻译成法语)。 因此,请确保在网站上选择正确的语言。

我希望你会喜欢

http://tortue-logo.fr is a browser version of the logo language. It is developped in javascript with raphaeljs (server side with python/django but the interpreter is running on the client side).

It only makes possible to play with the turtle but it may be enough to remind you good time learning how to program. :) i think it should cover the main commands of the LOGO language.

Currently french and english are supported. The french version of LOGO is different from the english one (commands are translated in french). SO make sure to choose the right language on the site.

I hope you'll enjoy

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文