discord-minesweeper

1.1.0 • Public • Published

Discord Minesweeper

Create games of minesweeper using Discords Spoiler Tags.

Usage

const mines = require('discord-minesweeper');
 
let output = mines(X, Y, mines, char, formatted);

Parameters

Parameter Description
X Width
Y Height
mines Number of mines
char Character to use internally to represent bombs. If formatted == false, this will be used to represent bombs in the output array.
formatted Whether to output as a formatted message (with line breaks and emojis) or as a 2D array.

Example

const Discord = require('discord.js');
const client = new Discord.Client();
 
...
 
client.on('message', msg => {
  if (msg.content === '!mines') {
    msg.author.send(mines(14, 14, 20, 'X', true););
  }
});

Readme

Keywords

none

Package Sidebar

Install

npm i discord-minesweeper

Weekly Downloads

2

Version

1.1.0

License

ISC

Unpacked Size

12.9 kB

Total Files

10

Last publish

Collaborators

  • nofishleft