-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
82e9e8f
commit 8eacc8f
Showing
3 changed files
with
67 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
export const pickRandom = <T>(array: T[]): T => array[Math.floor(Math.random() * array.length)]; | ||
|
||
export const generateRandomName = () => { | ||
const adjectives = [ | ||
"빠른", | ||
"느린", | ||
"큰", | ||
"작은", | ||
"아름다운", | ||
"멋진", | ||
"귀여운", | ||
"똑똑한", | ||
"게으른", | ||
"용감한", | ||
"겁많은", | ||
"행복한", | ||
"슬픈", | ||
"재미있는", | ||
"지루한", | ||
"친절한", | ||
"사나운", | ||
"순한", | ||
]; | ||
|
||
const animals = [ | ||
"호랑이", | ||
"사자", | ||
"곰", | ||
"토끼", | ||
"여우", | ||
"늑대", | ||
"고양이", | ||
"강아지", | ||
"코끼리", | ||
"기린", | ||
"원숭이", | ||
"팬더", | ||
"소", | ||
"양", | ||
"닭", | ||
"돼지", | ||
"오리", | ||
"뱀", | ||
"개구리", | ||
"물고기", | ||
]; | ||
|
||
const randomAdjective = pickRandom(adjectives); | ||
const randomAnimal = pickRandom(animals); | ||
|
||
return `${randomAdjective} ${randomAnimal}`; | ||
}; |
8eacc8f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Visual regression test result - success