STEP 9: Let's repeat the same process for the Rock Smash spell.

  • From , drag Call with Parameters to the bottom of the rock_smash() function.
  • Change my_function to calculate_damage, my_var1 to caster, and my_var2 to "rock_smash".
  • We pass this second argument to the calculate_damage() function to tell it which spell is being cast!
  • Click Run and try choosing b to see that the program is calculating damage for the Rock Smash spell!

To navigate the page using the TAB key, first press ESC to exit the code editor.

# THIS ACTIVITY IS IN PREVIEW ONLY MODE
  • Run Code
  • Submit Work
  • Next Activity
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)