An open API service indexing awesome lists of open source software.

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

Awesome Lists containing this project

README

          

# name-battle

[![npm](https://img.shields.io/npm/v/name-battle.svg)](https://www.npmjs.com/package/name-battle)
[![npm](https://img.shields.io/npm/dm/name-battle.svg)](https://npm-stat.com/charts.html?package=name-battle)
[![Build Status](https://travis-ci.org/msrose/name-battle.svg?branch=master)](https://travis-ci.org/msrose/name-battle)
[![codecov](https://codecov.io/gh/msrose/name-battle/branch/master/graph/badge.svg)](https://codecov.io/gh/msrose/name-battle)
[![Dependabot Status](https://api.dependabot.com/badges/status?host=github&repo=msrose/name-battle)](https://dependabot.com)
[![All Contributors](https://img.shields.io/badge/all_contributors-4-orange.svg?style=flat-square)](#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
Michael Rose

🚇 ⚠️ 💻Greenkeeper[bot]
Greenkeeper[bot]

🚇allcontributors[bot]
allcontributors[bot]

📖vikram-ravindran
vikram-ravindran

💻 📖 ⚠️

This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!