Skip to content

Commit

Permalink
Grasshopper - Messi goals function
Browse files Browse the repository at this point in the history
  • Loading branch information
PheRum committed Jun 13, 2024
1 parent f680f54 commit 6aaf839
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 16 deletions.
19 changes: 19 additions & 0 deletions 8_kyu/Grasshopper - Messi goals function/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
## Grasshopper - Messi goals function

https://www.codewars.com/kata/55f73be6e12baaa5900000d4

**Messi goals function**
Messi is a soccer player with goals in three leagues:

LaLiga
Copa del Rey
Champions
Complete the function to return his total number of goals in all three leagues.

Note: the input will always be valid.

For example:

```js
5, 10, 2 --> 17
```
8 changes: 8 additions & 0 deletions 8_kyu/Grasshopper - Messi goals function/index.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { goals } from "./index";

describe("Tests", () => {
it("goals", () => {
expect(goals(0, 0, 0)).toBe(0);
expect(goals(43, 10, 5)).toBe(58);
});
});
3 changes: 3 additions & 0 deletions 8_kyu/Grasshopper - Messi goals function/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export function goals(laLigaGoals: number, copaDelReyGoals: number, championsLeagueGoals: number): number {
return laLigaGoals + copaDelReyGoals + championsLeagueGoals;
}
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

### Katas solved

`Total`: 71 \
`8_kyu`: 54 \
`Total`: 72 \
`8_kyu`: 55 \
`7_kyu`: 13 \
`6_kyu`: 4 \
`5_kyu`: 0 \
Expand Down
14 changes: 0 additions & 14 deletions kata.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,30 +18,16 @@
8 kyu - Total amount of points - https://www.codewars.com/kata/5bb904724c47249b10000131
8 kyu - Calculate average - https://www.codewars.com/kata/57a2013acf1fa5bfc4000921
8 kyu - Reversed sequence - https://www.codewars.com/kata/5a00e05cc374cb34d100000d
8 kyu - Grasshopper - Messi goals function - https://www.codewars.com/kata/55f73be6e12baaa5900000d4
8 kyu - Basic Mathematical Operations - https://www.codewars.com/kata/57356c55867b9b7a60000bd7
8 kyu - Grasshopper - Terminal game move function - https://www.codewars.com/kata/563a631f7cbbc236cf0000c2
8 kyu - Convert a Boolean to a String - https://www.codewars.com/kata/551b4501ac0447318f0009cd
8 kyu - Reversed Words - https://www.codewars.com/kata/51c8991dee245d7ddf00000e
8 kyu - How good are you really? - https://www.codewars.com/kata/5601409514fc93442500010b
8 kyu - Simple multiplication - https://www.codewars.com/kata/583710ccaa6717322c000105
8 kyu - You Can't Code Under Pressure #1 - https://www.codewars.com/kata/53ee5429ba190077850011d4
8 kyu - Return Negative - https://www.codewars.com/kata/55685cd7ad70877c23000102
8 kyu - Convert a String to a Number! - https://www.codewars.com/kata/544675c6f971f7399a000e79
8 kyu - CSV representation of array - https://www.codewars.com/kata/5a34af40e1ce0eb1f5000036
8 kyu - Reversed Strings - https://www.codewars.com/kata/5168bb5dfe9a00b126000018
8 kyu - String repeat - https://www.codewars.com/kata/57a0e5c372292dd76d000d7e
8 kyu - Remove exclamation marks - https://www.codewars.com/kata/57a0885cbb9944e24c00008e
8 kyu - Counting sheep... - https://www.codewars.com/kata/54edbc7200b811e956000556
8 kyu - Even or Odd - https://www.codewars.com/kata/53da3dbb4a5168369a0000fe
8 kyu - Thinkful - Logic Drills: Traffic light - https://www.codewars.com/kata/58649884a1659ed6cb000072
8 kyu - Opposite number - https://www.codewars.com/kata/56dec885c54a926dcd001095
8 kyu - Sum Arrays - https://www.codewars.com/kata/53dc54212259ed3d4f00071c
8 kyu - Convert boolean values to strings 'Yes' or 'No'. - https://www.codewars.com/kata/53369039d7ab3ac506000467
8 kyu - Find Maximum and Minimum Values of a List - https://www.codewars.com/kata/577a98a6ae28071780000989
8 kyu - Sum of positive - https://www.codewars.com/kata/5715eaedb436cf5606000381
8 kyu - Convert number to reversed array of digits - https://www.codewars.com/kata/5583090cbe83f4fd8c000051
8 kyu - Add Length - https://www.codewars.com/kata/559d2284b5bb6799e9000047
8 kyu - Invert values - https://www.codewars.com/kata/5899dc03bc95b1bf1b0000ad
8 kyu - Filter out the geese - https://www.codewars.com/kata/57ee4a67108d3fd9eb0000e7
8 kyu - Beginner - Reduce but Grow - https://www.codewars.com/kata/57f780909f7e8e3183000078

0 comments on commit 6aaf839

Please sign in to comment.