-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add new-life.ts for generating new player's random life (wip)
- Loading branch information
1 parent
5ff2464
commit 060f2bd
Showing
4 changed files
with
37 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
{ | ||
"extends": ["next/core-web-vitals", "prettier"] | ||
"extends": ["next/core-web-vitals", "prettier"], | ||
"ignorePatterns": ["node_modules/*", ".next/*"] | ||
} |
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,25 @@ | ||
import COUNTRIES_DATA from '../../public/countries.json'; | ||
import NAMES_DATA from '../../public/names.json'; | ||
|
||
const generateCountry = () => { | ||
const countryList = Object.keys(COUNTRIES_DATA); | ||
const country = countryList[Math.floor(Math.random() * countryList.length)]; | ||
return country; | ||
}; | ||
|
||
const generateName = (country: string) => { | ||
//const countryNameGroup = COUNTRIES_DATA[country]; | ||
//const countryNameData = COUNTRIES_DATA[country]; | ||
console.log(NAMES_DATA); | ||
return 'John Doe'; | ||
}; | ||
|
||
export const createNewLife = () => { | ||
const country = generateCountry(); | ||
const name = generateName(country); | ||
|
||
return { | ||
country, | ||
name, | ||
}; | ||
}; |
060f2bd
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.
Successfully deployed to the following URLs:
lifely – ./
lifely-carboxydev.vercel.app
lifely.carboxy.tech
lifely-git-master-carboxydev.vercel.app