Update animal.sm
This commit is contained in:
parent
e98f230db1
commit
f174ec9927
1 changed files with 6 additions and 6 deletions
|
@ -2,7 +2,7 @@
|
||||||
&& '++name declares an abstract class
|
&& '++name declares an abstract class
|
||||||
&& all of that is, of course, a statement so ¡!
|
&& all of that is, of course, a statement so ¡!
|
||||||
|
|
||||||
¡'++animal
|
'++animal (
|
||||||
&& +}}type{{ declares a property of a class
|
&& +}}type{{ declares a property of a class
|
||||||
&& "+}}type{{ declares a static property of a class
|
&& "+}}type{{ declares a static property of a class
|
||||||
|
|
||||||
|
@ -10,17 +10,17 @@
|
||||||
¡+}}string{{ speed!;
|
¡+}}string{{ speed!;
|
||||||
|
|
||||||
&& ### declares the constructor
|
&& ### declares the constructor
|
||||||
¡### /}}string{{ name\ /speed\ |
|
### /}}string{{ name\ /speed\ | (
|
||||||
¡<=/"Created animal named " + name\!;
|
¡<=/"Created animal named " + name\!;
|
||||||
|
|
||||||
&& +var refers to a property, like this. in other languages
|
&& +var refers to a property, like this. in other languages
|
||||||
&& you can only assign values to static variables once in this language
|
&& you can only assign values to static variables once in this language
|
||||||
¡+name < name!;
|
¡+name < name!;
|
||||||
¡+speed < speed!;
|
¡+speed < speed!;
|
||||||
!
|
)
|
||||||
|
|
||||||
&& +# declares a method
|
&& +# declares a method
|
||||||
¡+#walk /distance\ |
|
+#walk /distance\ | (
|
||||||
¡<=/¿+name + " walked " + (+speed * +distance)?\!;
|
¡<=/¿+name + " walked " + (+speed * +distance)?\!;
|
||||||
!
|
)
|
||||||
!
|
)
|
||||||
|
|
Loading…
Reference in a new issue