This commit is contained in:
hgw 2023-10-02 05:14:21 +00:00
commit e8d0b7bf47
Signed by: hgw
SSH Key Fingerprint: SHA256:diG7RVYHjd3aDYkZWHYcBJbImu+6zfptuUP+3k/wol4
5 changed files with 135 additions and 0 deletions

15
LICENSE Normal file
View File

@ -0,0 +1,15 @@
ISC License
Copyright (c) 2023 hgw7
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.

45
README.md Normal file
View File

@ -0,0 +1,45 @@
# phishies
## Node.js aquarium generator module
This module is still in early stages of development, probabilities still need to be tweaked further.
# Getting Started
## Installation
To install for just your project:
```
npm i phishies
```
To install globally:
```
npm i phishies -g
```
## Use in script
```
var phish = require('phish2')
```
# Usage
Currently the only available use is the main aquarium generator, which is invoked by using `phish.aquarium(height, length)`. The output of the aquarium generator is an array with each line as a value
Example `phish.aquarium(5,5) output`:
```
[ '     ', ' 🐡   ', '   🐡🐠', '🐙🐡 🦑 ', '  🦀🌿 ' ]
```
# Credits
This project was inspired entirely by https://botsin.space/@EmojiAquarium, source code found at https://gitlab.com/JoeSondow/fishies
# License
This module is licensed under the ISC license.

5
package-lock.json generated Normal file
View File

@ -0,0 +1,5 @@
{
"name": "phishies",
"version": "1.0.0",
"lockfileVersion": 1
}

13
package.json Normal file
View File

@ -0,0 +1,13 @@
{
"name": "phishies",
"version": "1.0.0",
"description": "Node.js aquarium generator module",
"main": "phish.js",
"repository": {
"type": "git",
"url": "https://git.supernets.org/hgw/phish2.git"
},
"author": "hgw",
"license": "ISC",
"dependencies": {}
}

57
phish.js Normal file
View File

@ -0,0 +1,57 @@
// __ _ __
// ____ / /_ (_)____/ /_
// / __ \/ __ \/ / ___/ __ \
// / /_/ / / / / (__ ) / / /
// / .___/_/ /_/_/____/_/ /_/
// /_/
//
// https://git.supernets.org/hgw/phish
// Aquarium generator - ANOTHER SUPERNETS BANGER
// Inspired by https://botsin.space/@EmojiAquarium
var fish_types = ["🐟", "🐡", "🐠"]
var rare_swimmer_types = ["🐙", "🐬", "🦑", "🦈"]
var plant_types = ["🌱", "🌾", "🌿"]
var rare_bottom_dwellers = ["🪨", "🐌", "🏰", "🦀", "🐚", "⚓️", "☘️"]
var exceedingly_rare_junk = ["🎱", "🎲", "🎮", "🗿","🔱", "🎷", "🗽", "💎", "💰", "🔔", "💀", "💩"]
function aquarium(height, width) {
aquariumArray = []
if (height == undefined) {
height == 5
}
if (width == undefined) {
width = 6
}
for(let i = 0; i < height; i++) {
lineArr = []
if (i != height-1) {
for(let i = 0; i < width; i++) {
if (Math.random()*100<13) {
lineArr.push(fish_types[Math.floor(Math.random()*fish_types.length)])
} else if (Math.random()*100<3) {
lineArr.push(rare_swimmer_types[Math.floor(Math.random()*rare_swimmer_types.length)])
} else {
lineArr.push(' ')
}
}
}
if (i == height-1) {
for(let i = 0; i < width; i++) {
if (Math.random()*100<30) {
lineArr.push(plant_types[Math.floor(Math.random()*plant_types.length)])
} else if (Math.random()*100<20) {
lineArr.push(rare_bottom_dwellers[Math.floor(Math.random()*rare_bottom_dwellers.length)])
} else if (Math.random()*100<1) {
lineArr.push(exceedingly_rare_junk[Math.floor(Math.random()*exceedingly_rare_junk.length)])
} else {
lineArr.push(' ')
}
}
}
aquariumArray.push(lineArr.join(''))
}
return aquariumArray
}
module.exports = { aquarium }