about | help | code help+videos | done | prefs |
StarWarsEpicBattle
Write a method that determines the outcome of an epic battle in Star Wars. The input parameters will indicate how much strength each side has in lightsaber skills and in Force powers. The Force powers are twice as effective as the lightsaber skills. The side with more total points wins! If the Dark Side wins, return -1. If the Light Side wins, return 1. If they tie, return 0. For each category, the points will be zero or greater. StarWarsEpicBattle(3, 4, 4, 3) → -1 StarWarsEpicBattle(5, 2, 3, 3) → 0 StarWarsEpicBattle(6, 1, 6, 1) → 0 ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 250
Copyright Nick Parlante 2017 - privacy