commit e8d0b7bf47a03e42193035c51af52196048e7aa7 Author: hgw Date: Mon Oct 2 05:14:21 2023 +0000 init diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..221d2dd --- /dev/null +++ b/LICENSE @@ -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. \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..48fcfda --- /dev/null +++ b/README.md @@ -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. \ No newline at end of file diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..a86f6f3 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,5 @@ +{ + "name": "phishies", + "version": "1.0.0", + "lockfileVersion": 1 +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..873d15c --- /dev/null +++ b/package.json @@ -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": {} +} diff --git a/phish.js b/phish.js new file mode 100644 index 0000000..15bdaef --- /dev/null +++ b/phish.js @@ -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 } \ No newline at end of file