https://github.com/msrose/name-battle
:name_badge: Simulate battles in a parallel universe
https://github.com/msrose/name-battle
battle name
Last synced: 3 months ago
JSON representation
:name_badge: Simulate battles in a parallel universe
- Host: GitHub
- URL: https://github.com/msrose/name-battle
- Owner: msrose
- License: mit
- Created: 2019-03-23T02:10:20.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2023-01-06T01:45:35.000Z (over 3 years ago)
- Last Synced: 2025-10-23T05:52:42.582Z (7 months ago)
- Topics: battle, name
- Language: JavaScript
- Size: 387 KB
- Stars: 7
- Watchers: 1
- Forks: 0
- Open Issues: 14
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# name-battle
[](https://www.npmjs.com/package/name-battle)
[](https://npm-stat.com/charts.html?package=name-battle)
[](https://travis-ci.org/msrose/name-battle)
[](https://codecov.io/gh/msrose/name-battle)
[](https://dependabot.com)
[](#contributors)
:name_badge: Simulate battles in a parallel universe
The original concept for the sacred Name Battle was proposed by [@vikram-ravindran](https://github.com/vikram-ravindran) during a magnificent state of pure lucidity during which he was capable of anything he so desired. He desired to unveil the Name Battle to the world, and so it was:
> The purpose of this function is to simulate a battle in a parallel universe in which, when a person attacks another person (the target), they do so by absorbing letters in the target's name that match the attacker's name, and the percentage of letters left over gives the current life-force level of the target as a percentage (100% is full-health)
## Installation
```
npm install name-battle
```
## Usage
```javascript
const nameBattle = require('name-battle')
nameBattle({ attacker: 'Vikram Ravindran', target: 'Michael Rose' })
```
## API
### Default Export
```
nameBattle(combatants)
```
Conducts a name battle between the specified combatants
#### Arguments
1. `combatants` _(Object)_: An object describing the participants in the Name Battle
- `combatants.attacker` _(String)_: The name of the attacker
- `combatants.target` _(String)_: The name of the target
#### Returns
_(Number)_: The remaining Life Force of the target after they have been engaged in a Name Battle by the attacker
## Contributors
Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):

Michael Rose
🚇 ⚠️ 💻![Greenkeeper[bot]](https://avatars3.githubusercontent.com/in/505?v=4)
Greenkeeper[bot]
🚇![allcontributors[bot]](https://avatars0.githubusercontent.com/in/23186?v=4)
allcontributors[bot]
📖
vikram-ravindran
💻 📖 ⚠️
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!