Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: 'For UFC Fans (Total Beginners): Conor McGregor vs George Saint… #230

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import quote from '.';

describe('quote', () => {
it('should return winner statement', () => {
expect.assertions(4);

expect(quote('george saint pierre')).toBe('I am not impressed by your performance.');
expect(quote('conor mcgregor')).toBe(
"I'd like to take this chance to apologize.. To absolutely NOBODY!",
);
expect(quote('George Saint Pierre')).toBe('I am not impressed by your performance.');
expect(quote('Conor McGregor')).toBe(
"I'd like to take this chance to apologize.. To absolutely NOBODY!",
);
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
function quote(fighter: string): string | undefined {
const normalized = fighter.toLocaleLowerCase();

if (normalized.toLowerCase() === 'george saint pierre') {
return 'I am not impressed by your performance.';
}

if (normalized.toLocaleLowerCase() === 'conor mcgregor') {
return "I'd like to take this chance to apologize.. To absolutely NOBODY!";
}

return undefined;
}

export default quote;
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# [For UFC Fans (Total Beginners): Conor McGregor vs George Saint Pierre](https://www.codewars.com/kata/582dafb611d576b745000b74)

This is a beginner friendly kata especially for UFC/MMA fans.

It's a fight between the two legends: Conor McGregor vs George Saint Pierre in Madison Square Garden. Only one fighter will remain standing, and after the fight in an interview with Joe Rogan the winner will make his legendary statement. It's your job to return the right statement depending on the winner!

If the winner is George Saint Pierre he will obviously say:

- "I am not impressed by your performance."

If the winner is Conor McGregor he will most undoubtedly say:

- "I'd like to take this chance to apologize.. To absolutely NOBODY!"

Good Luck!

## Note

The given name may varies in casing, eg., it can be "George Saint Pierre" or "geOrGe saiNT pieRRE". Your solution should treat both as the same thing (case-insensitive).

---

## Tags

- Fundamentals