@edadma/logo 0.0.2 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +30 -0
- package/dist/main.js +71205 -0
- package/dist/main.js.map +8 -0
- package/package.json +8 -7
- package/src/Logo.d.ts +63 -0
- package/src/index.d.ts +1 -0
- package/src/main/scala/io/github/edadma/logo/LogoJS.scala +307 -0
- package/dist/logo.js +0 -48901
package/README.md
CHANGED
|
@@ -141,6 +141,9 @@ interface TurtleState {
|
|
|
141
141
|
- `left <angle>` / `lt` - Turn left (degrees)
|
|
142
142
|
- `setxy <x> <y>` - Move to position
|
|
143
143
|
- `home` - Return to center
|
|
144
|
+
- `towards [x y]` - Return heading toward point
|
|
145
|
+
- `distance [x y]` - Return distance to point
|
|
146
|
+
- `arc <angle> <radius>` - Draw an arc
|
|
144
147
|
|
|
145
148
|
### Pen Control
|
|
146
149
|
- `penup` / `pu` - Lift pen
|
|
@@ -154,6 +157,10 @@ interface TurtleState {
|
|
|
154
157
|
|
|
155
158
|
### Control Flow
|
|
156
159
|
- `repeat <n> [commands]` - Repeat commands
|
|
160
|
+
- `for [var start end step] [commands]` - For loop
|
|
161
|
+
- `while [condition] [commands]` - While loop
|
|
162
|
+
- `until [condition] [commands]` - Until loop
|
|
163
|
+
- `forever [commands]` - Loop until stop/output
|
|
157
164
|
- `if <cond> [commands]` - Conditional
|
|
158
165
|
- `ifelse <cond> [yes] [no]` - If-else
|
|
159
166
|
|
|
@@ -180,6 +187,8 @@ interface TurtleState {
|
|
|
180
187
|
- `make "name <value>` - Set variable
|
|
181
188
|
- `:name` - Get variable value
|
|
182
189
|
- `thing "name` - Get variable value
|
|
190
|
+
- `local "name` - Declare procedure-local variable
|
|
191
|
+
- `localmake "name <value>` - Declare and set local variable
|
|
183
192
|
|
|
184
193
|
### Lists
|
|
185
194
|
- `first`, `last`, `butfirst` (`bf`), `butlast` (`bl`)
|
|
@@ -189,6 +198,27 @@ interface TurtleState {
|
|
|
189
198
|
- `reverse`, `pick` - list utilities
|
|
190
199
|
- `emptyp`, `listp`, `wordp`, `numberp`, `memberp` - predicates
|
|
191
200
|
|
|
201
|
+
### Time
|
|
202
|
+
- `time` - Returns `[hours minutes seconds]` (UTC)
|
|
203
|
+
- `date` - Returns `[year month day]` (UTC)
|
|
204
|
+
- `timemilli` - Milliseconds since epoch
|
|
205
|
+
|
|
206
|
+
### Workspace Inspection
|
|
207
|
+
- `namep "name` / `name? "name` - Is variable defined?
|
|
208
|
+
- `definedp "name` / `defined? "name` - Is procedure defined?
|
|
209
|
+
- `primitivep "name` / `primitive? "name` - Is it a primitive?
|
|
210
|
+
- `procedurep "name` / `procedure? "name` - Is it a user procedure?
|
|
211
|
+
- `procedures` - List all user procedures
|
|
212
|
+
- `primitives` - List all primitives
|
|
213
|
+
- `names` - List all variables
|
|
214
|
+
|
|
215
|
+
### Higher-Order Functions
|
|
216
|
+
- `map <fn> <list>` - Apply function to each element
|
|
217
|
+
- `filter <fn> <list>` - Keep elements where fn returns true
|
|
218
|
+
- `reduce <fn> <list>` - Reduce list to single value
|
|
219
|
+
- `foreach <list> <fn>` - Execute fn for each element
|
|
220
|
+
- `apply <fn> <list>` - Apply fn with list as arguments
|
|
221
|
+
|
|
192
222
|
## License
|
|
193
223
|
|
|
194
224
|
ISC
|