Make an RPG
The function definition is like a todo list for you computer.
This is a function definition:
' ); }
This is how you execute that function:
Copy and paste the above function call, so that it appears below the function definition:
' ); } print( "hello" );
Hit the green Run button. Now you should see that "hello" has been printed out in the run window at the bottom right.
Let's write a function to add 2 variables: a and b
Copy that function into your code, after the print_me function. Now we're going to call that function, like so
The return value is a variable that's based back from the function. Let's remove the print statement and add a return value like so:
Now change the function call like so:
When you hit the run button, you should see 16. Now, we're going to sum the result of one addition with the result of another addition:
Get the Latest Tutorial Updates