Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- %==========================================================================
- % PROBLEM 2. Battles with Starter Pokemon
- %--------------------------------------------------------------------------
- %
- % Function Name: iChooseYou
- % Inputs (2): - (char) a string containing the Pokemon that you are using
- % - (char) a string containing the Pokemon that your rival is
- % using
- % Outputs (1): - (char) a string telling which player has the type
- % advantage
- %
- % Function Description:
- % You have just chosen a starter Pokemon, and now your rival wants to
- % battle! You want to determine which of your Pokemon has the type
- % advantage over the other, so you use MATLAB to help you in this
- % endeavor.
- %
- % Write a function called "iChooseYou" that takes in a string containing
- % the Pokemon that you are using and a string containing the Pokemon that
- % your rival is using. The strings will only contain 'Charmander',
- % 'Squirtle', or 'Bulbasaur'. The function should then output a string
- % describing which person has the type advantage. If you have the type
- % advantage, then the function should return 'No sweat!', but if your
- % rival has the type advantage, then the string should say 'This will be
- % difficult...'
- %
- % For those who are unfamiliar with Pokemon, the type advantages are as
- % follows:
- %
- % - Charmander has a type advantage over Bulbasaur
- % - Bulbasaur has a type advantage over Squirtle
- % - Squirtle has a type advantage over Charmander
- %
- % Notes:
- % - You and your rival will never have the same Pokemon, i.e. the inputs
- % will never be the same string.
- %
- % Test Cases:
- %
- % poke1 = iChooseYou('Squirtle', 'Bulbasaur');
- % poke1 => 'This will be difficult...'
- %
- % poke2 = iChooseYou('Charmander', 'Bulbasaur');
- % poke2 => 'No sweat!'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement