Skip to content

Commit

Permalink
Take an Arrow to the knee, Functionally
Browse files Browse the repository at this point in the history
  • Loading branch information
PheRum committed May 18, 2024
1 parent 64b8e46 commit c56b95a
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 2 deletions.
19 changes: 19 additions & 0 deletions 8_kyu/Take an Arrow to the knee, Functionally/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
## Take an Arrow to the knee, Functionally

https://www.codewars.com/kata/559f3123e66a7204f000009f

**Arrow style Functions**

Come here to practice the Arrow style functions Not much else to say good luck!

**Details**

You will be given an array of numbers which can be used using the String.fromCharCode() (JS), Tools.FromCharCode() (C#) method to convert the number to a character. It is recommended to map over the array of numbers and convert each number to the corresponding ascii character.

**Examples**

These are example of how to convert a number to an ascii Character:
Javascript => String.fromCharCode(97) // a
C# => Tools.FromCharCode(97) // a

**Reference**: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions
8 changes: 8 additions & 0 deletions 8_kyu/Take an Arrow to the knee, Functionally/index.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { arrowFunc } from "./index";

describe("Tests", () => {
it("arrowFunc", () => {
expect(arrowFunc([84, 101, 115, 116])).toEqual("Test");
expect(arrowFunc([70, 85, 83, 32, 82, 79, 72, 32, 68, 65, 72])).toEqual("FUS ROH DAH");
});
});
3 changes: 3 additions & 0 deletions 8_kyu/Take an Arrow to the knee, Functionally/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export function arrowFunc(numbers: number[]) {
return numbers.map((item) => String.fromCharCode(item)).join("");
}
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

### Katas solved

`Total`: 35 \
`8_kyu`: 34 \
`Total`: 36 \
`8_kyu`: 35 \
`7_kyu`: 0 \
`6_kyu`: 1 \
`5_kyu`: 0 \
Expand Down

0 comments on commit c56b95a

Please sign in to comment.