added cat.sm
This commit is contained in:
parent
660294523e
commit
e98f230db1
2 changed files with 43 additions and 11 deletions
|
@ -0,0 +1,32 @@
|
|||
&& import via &=>
|
||||
¡&=> "animal.sm"!
|
||||
|
||||
&& inherit via :::
|
||||
++cat:::animal (
|
||||
¡+}}float{{ meowingVolume!;
|
||||
|
||||
### /}}string{{ name\ /}}float{{ speed\ /}}float{{ meowingVolume\ | (
|
||||
&& ## calls the super
|
||||
¡##/name, speed\!;
|
||||
¡+meowingVolume < meowingVolume!;
|
||||
)
|
||||
|
||||
+#meow /\ | (
|
||||
¿??€/+meowingVolume >> 0\ | (
|
||||
¡<=/"*silence*"!;
|
||||
) ?>$/+meowingVolume >> 0\ | (
|
||||
¡<=/"mow"\!;
|
||||
) ?>$/+meowingVolume >> 2\ | (
|
||||
¡<=/"meow"\!;
|
||||
) ?>$/+meowingVolume >> 5\ | (
|
||||
¡<=/"Meow."\!;
|
||||
) ?>$/+meowingVolume >> 10\ | (
|
||||
¡<=/"Meow!!"\!;
|
||||
) ?>$/+meowingVolume >> 20\ | (
|
||||
¡<=/"MEOW!!!"\!;
|
||||
) >? | (
|
||||
!<=/"Error: weird as fuck meowing volume."\!;
|
||||
)
|
||||
)
|
||||
)
|
||||
|
|
@ -1,5 +1,6 @@
|
|||
#mult /}}string{{str\ /{float}num\ |
|
||||
#mult /}}string{{str\ /{float}num\ | (
|
||||
¿string * float?
|
||||
)
|
||||
|
||||
&& rest line comment
|
||||
|
||||
|
@ -34,26 +35,25 @@
|
|||
&& = is equal to ===
|
||||
|
||||
&& if condition is true log the text
|
||||
¿??$/condition\ |
|
||||
¿??$/condition\ | (
|
||||
¡<=/"condition was true"!
|
||||
?
|
||||
)?
|
||||
|
||||
&& if condition is false log the text
|
||||
¿??€/condition\ |
|
||||
¿??€/condition\ | (
|
||||
¡<=/"condition was false"!
|
||||
?
|
||||
|
||||
¿??$/condition\ |
|
||||
¡<=
|
||||
)?
|
||||
|
||||
#sub /\ | (
|
||||
&& This code prints hello world
|
||||
¿??$? |
|
||||
¿??$? | (
|
||||
!<= "Hello World"!;
|
||||
)
|
||||
)
|
||||
|
||||
#sub /\ | (
|
||||
&& This code checks if input is equal to another string
|
||||
¿??$ /=> "hello"\? | && Takes input and compares to string
|
||||
¿??$ /=> "hello"\? | ( && Takes input and compares to string
|
||||
!<= "World!"!; Prints World!
|
||||
)?
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue