Code improvement - 3


Yeah ! 

Most of the new syntax is functional ! Some tweaks will probably be required, but it fells much more readable and flexible !

#Start
    #Testing( &First(Hello) , #World , "!!!" )
 
#Testing(param1, param2, param3)
        @param1 @param2 @param3
    
#World
    world
    planet
    earth

Results :

Hello world !!!
Hello planet !!!
Hello earth !!!

Here is what is going on :

When calling the rule #Start, it will exectute #Testing with 3 parameters. The good stuff is that it is now possible to do some logic on the parameters. Here 3 different things are done :

First parameter : &First(Hello) -> Sets the variable "First" to "Hello", and at the same time returns its new value.

Second parameter : #World -> Executes the rule "world"  which returns one of the random lines

Third parameter : "!!!" -> simply returns the string  "!!!"

Leave a comment

Log in with itch.io to leave a comment.