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)
from minesweeper import main if __name__ == '__main__': main()
def setUp(self): from minesweeper import main app = main({}) from webtest import TestApp self.testapp = TestApp(app)
import minesweeper minesweeper.main()
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
def setUp(self): from minesweeper import main from webtest import TestApp app = main({}) self.testapp = TestApp(app)