test some formatting
This commit is contained in:
parent
936bd238bf
commit
0ec2b1ec11
|
@ -103,7 +103,7 @@ Whenever you write, or copy, a nice function, make a few changes to it so that i
|
|||
|
||||
### Equipment
|
||||
Your most important piece of equipment is a notebook.
|
||||
It is far more important than the computer you work on and all the technical manuals at your disposal.
|
||||
It is far more important than the computer you work on and the documentation you consult.
|
||||
Select a notebook with large, unlined, and bound-in pages.
|
||||
I want you to keep track of your work in this notebook.
|
||||
That means everything: the little sketches, word portraits, diagrams, function listings, the printed images.
|
||||
|
@ -125,10 +125,12 @@ Get a lot of it.
|
|||
Be careful using this glue, though; it is very flammable.
|
||||
Don't smoke and glue at the same time.
|
||||
|
||||
> Don't smoke.
|
||||
> Don't smoke at all.
|
||||
|
||||
> But seriously, even though you might imagine that we're fully digital, nearly four decades later, we encourage you, still, to use pen and paper liberally. Rubber cement may be less interesting, and you're probably not reading magazines. But we take tools and media and affordances seriously, and pen and paper are what you want, not some shiny new digital toy.
|
||||
|
||||
> Oh, and you _will_ need Ludus: [web.ludus.dev](https://web.ludus.dev).
|
||||
|
||||
<!--
|
||||
### Dialects
|
||||
Unfortunately, there is not just one Ludus.
|
||||
|
@ -159,7 +161,7 @@ But it just so happens that Ludus is easier to learn and easier to use than most
|
|||
Ludus notation is neat and tidy; it looks nice on the page and that encourages visual thinking.
|
||||
But most important, because Ludus is so easy to play around with, it won't get in the way.
|
||||
|
||||
> In fact, while we're sure Logo had some of these advantages over its competition (Clayson used Pascal, not Python, as his strawman here), we have different ideas about what's interesting about Ludus. We think Ludus, like Logo, is better for learning _how to think well with computers_, and that it teaches a different set of things than you might learn in a typical introductory programming situation, whether that be computer-scientific, artistic or creative, or digital-humanistic.
|
||||
> In fact, while we're sure Logo had some of these advantages over its competition (Clayson used Pascal, not Python, as his strawman here), we have different ideas about what's interesting about Ludus than what Clayson notes here. We think Ludus, like Logo, is better for learning _how to think well with computers_, and that it teaches a different set of things than you might learn in a typical introductory programming situation, whether that be computer-scientific, artistic or creative, or digital-humanistic.
|
||||
|
||||
### Turtles are us
|
||||
We will concentrate on the graphic parts of Ludus.
|
||||
|
@ -454,31 +456,31 @@ Here are some walking plans that you might issue to the turtle to do `ngon`s.
|
|||
How can you calculate the angle indicated by the "?" for any n-sided polygon?
|
||||
Your geometric intuition should tell you that the turtle, after making `n` turns, will end up facing the same direction in which it started.
|
||||
The amount of each individual turn is simply a fraction of a whole turn, or `1/n`.
|
||||
|
||||
Now is the time to understand Ludus's mathematical capacities.
|
||||
Consult the [Ludus documentation](https://alea.ludus.dev/twc/ludus/src/branch/main/prelude.md#math) for the functions to `add`, `sub`tract, `mult`iply, and `div`ide.
|
||||
|
||||
#### Angles in Ludus
|
||||
Unlike high school geometry, Logo, or most other programming languages, Ludus measures its geometry in _turns_, rather than degrees or radians.
|
||||
There are 360 degrees in a circle, and `2*pi` radians.
|
||||
There is one single turn.
|
||||
This is closer to lived geometry (turn a quarter turn to right, not 90 degrees).
|
||||
It also simplifies much of the arithmetic here: we don't need to multiply or divide 360 or `2*pi` by anything.
|
||||
> #### Angles in Ludus
|
||||
> Unlike high school geometry, Logo, or most other programming languages, Ludus measures its geometry in _turns_, rather than degrees or radians.
|
||||
> There are 360 degrees in a circle, and `2*pi` radians.
|
||||
> There is one single turn.
|
||||
> This is closer to lived geometry (turn a quarter turn to right, not 90 degrees).
|
||||
> It also simplifies much of the arithmetic here: we don't need to multiply or divide 360 or `2*pi` by anything.
|
||||
>
|
||||
> For example, Ludus has a very useful function named `inv`, which calculates the _inverse_ of its argument: `inv (n)` returns `1/n`.
|
||||
> So in this case, the angle to turn is simple `inv (n)`.
|
||||
>
|
||||
> #### Arithmetic in Ludus
|
||||
> Unlike many programming languages, Ludus does not have arithmetic operators.
|
||||
> In place of `2 + 2`, you will need to use the function `add`: `add (2, 2)`.
|
||||
> It will take some getting used to to read math expressed this way.
|
||||
> But it does offer a profound insight: nearly _everything_ in Ludus is a function call.
|
||||
> Addition isn't a special kind of thing.
|
||||
>
|
||||
> In addition, notice that while we have seen `forward!` and `right!` and `box!`, `add`'s name does not end in an exclamation point.
|
||||
> That is because, unlike a command, which makes something happen, it instead gives something back to you: the computed value.
|
||||
> Commands are actually special functions; `add` is a normal function.
|
||||
|
||||
For example, Ludus has a very useful function named `inv`, which calculates the _inverse_ of its argument: `inv (n)` returns `1/n`.
|
||||
So in this case, the angle to turn is simple `inv (n)`.
|
||||
|
||||
#### Arithmetic in Ludus
|
||||
Unlike many programming languages, Ludus does not have arithmetic operators.
|
||||
In place of `2 + 2`, you will need to use the function `add`: `add (2, 2)`.
|
||||
It will take some getting used to to read math expressed this way.
|
||||
But it does offer a profound insight: nearly _everything_ in Ludus is a function call.
|
||||
Addition isn't a special kind of thing.
|
||||
|
||||
In addition, notice that while we have seen `forward!` and `right!` and `box!`, `add`'s name does not end in an exclamation point.
|
||||
That is because, unlike a command, which makes something happen, it instead gives something back to you: the computed value.
|
||||
Commands are actually special functions; `add` is a normal function.
|
||||
|
||||
#### Back to `ngon!`
|
||||
You are ready to write the new function `ngon!`:
|
||||
|
||||
```
|
||||
|
|
Loading…
Reference in New Issue
Block a user