Esempio n. 1
0
async def minesweeper(ctx, size=10, difficulty=2):
    text = (
        "**MINESWEEPER**"
        "\nBy Wylarel\n"
        "\n*Size:* `{size}x{size}` | *Difficulty:* `{difficulty}` | *Mines:* `{mines}`\n"
        "\n**Grid:**\n{grid}\n"
        "\n**Solution:**\n||{solution}||")
    output = ms.main(text=text, size=size, difficulty=difficulty)
    if len(output) > 2000:
        await ctx.send(":x: The grid is too big for Discord (" +
                       str(len(output)) + " characters)")
        return

    await ctx.send(output)
Esempio n. 2
0
from minesweeper import main


if __name__ == '__main__':

    main()
Esempio n. 3
0
 def setUp(self):
     from minesweeper import main
     app = main({})
     from webtest import TestApp
     self.testapp = TestApp(app)
Esempio n. 4
0
import minesweeper
minesweeper.main()
Esempio n. 5
0
import minesweeper
import pyperclip

text = (
    "**MINESWEEPER**"
    "\nBy Wylarel\n"
    "\n*Size:* `{size}x{size}` | *Difficulty:* `{difficulty}` | *Mines:* `{mines}`\n"
    "\n**Grid:**\n{grid}\n"
    "\n**Solution:**\n||{solution}||")

OUTPUT = minesweeper.main(text=text)  # Get the output with the default
print(OUTPUT)  # Print the output in the console
pyperclip.copy(OUTPUT)  # Copy the output in the clipboard
Esempio n. 6
0
 def setUp(self):
     from minesweeper import main
     from webtest import TestApp
     app = main({})
     self.testapp = TestApp(app)