Skip to content

Commit dc4e110

Browse files
committed
Fix examples
1 parent 6f16333 commit dc4e110

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

readme.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ func add_numbers ( a, b ) {
257257

258258
Functions can not be retroactively assigned to variables. As such, the following is **invalid** syntax:
259259
```
260-
let add_numbers = function( a, b ) {
260+
let add_numbers = functi( a, b ) {
261261
262262
let c = a + b;
263263
return c;
@@ -387,7 +387,7 @@ Similar to print, Input is a language defined input function. It allows for a pr
387387

388388
The following is a valid input statement:
389389
```
390-
let a = input ( "Please enter your name: " )
390+
let a = input ( "Please enter your name: " );
391391
```
392392

393393
### Loops
@@ -404,10 +404,10 @@ loop ( a in range( 1, 100 ) ) {
404404

405405
While loops are also possible:
406406
```
407-
let a = 1
407+
let a = 1;
408408
loop ( while a < 100 ) {
409409
print ( a );
410-
a = a + 1;
410+
a += 1;
411411
}
412412
```
413413

@@ -434,12 +434,12 @@ string ( x );
434434

435435
You can also quickly get the type of a variable using the `type()` function:
436436
```
437-
x = 3
437+
let x = 3;
438438
439439
# prints `Number`
440440
print ( type ( x ) );
441441
442-
string ( x );
442+
x = string ( x );
443443
444444
# prints `String`
445445
print ( type ( x ) );
@@ -450,7 +450,7 @@ You can also get the length of a list with `len()`:
450450
let x = [ 1, 2, 3 ];
451451
452452
# returns `2`
453-
len( x );
453+
print ( len( x ) );
454454
```
455455

456456
### Importing functions
@@ -496,7 +496,7 @@ print_e();
496496
Likewise, the following should print `[e: 3, x: 5]`
497497
```
498498
let e = 3;
499-
let list = [ e, x = 5 ];
499+
let list = [ e, x: 5 ];
500500
e = 4;
501501
print ( list );
502502
```

0 commit comments

Comments
 (0)