Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- some very nice minesweep
- Last update: 4/19/2019 2:38:09 PM
- Finished! (ver 1.1)
- Made for the ComputerCraft mod by dan200
- Made using the ComputerCraft emulator by GravityScore and 1lann
- Helpful guides: https://www.computercraft.info/wiki/Category:Lua_Core_Functions and https://www.computercraft.info/wiki/Category:APIs
- Part of the Minesweeper Project [https://pastebin.com/Yftb7QWL]
- Ver 1.0:
- - Completed using windows, Roblox, and just a touch of salt.
- Ver 1.01:
- - More Death Messages were added. (22 current)
- Ver 1.02:
- - Added even more Death Messages (30 current)
- Ver 1.1:
- - Added win detections with custom win messages. (10 messages)
- ]]
- local inputArgs = {...} -- Hey lets, you know, allow people to use it with preset parameters.
- if inputArgs[1] then
- if inputArgs[1]:lower() == "help" or inputArgs[1]:lower() == "?" then
- print("Syntax: mine [difficulty]")
- print(" mine custom <width> <height> <mines>")
- return
- end
- end
- term.clear()
- local board = {} -- Holds everything
- local boardSettings = {} -- {Width, Height, MineCount, EmptySpaces, Difficulty}
- local difficulty
- local inputWidth
- local inputHeight
- local inputMines
- --This will help with RNG
- math.randomseed(os.time())
- if inputArgs[1] then
- difficulty = inputArgs[1]
- if difficulty == "easy" then
- inputWidth = 8
- inputHeight = 8
- inputMines = 10
- elseif difficulty == "normal" then
- inputWidth = 16
- inputHeight = 16
- inputMines = 40
- elseif difficulty == "hard" then
- inputWidth = 32
- inputHeight = 16
- inputMines = 99
- elseif difficulty == "custom" then
- inputWidth = tonumber(inputArgs[2])
- if inputWidth == nil or inputWidth <= 0 then inputWidth = nil end
- inputHeight = tonumber(inputArgs[3])
- if inputHeight == nil or inputHeight <= 0 then inputHeight = nil end
- inputMines = tonumber(inputArgs[4])
- if inputMines == nil then if inputMines <= 0 or inputMines >= boardArea then inputMines = nil end end
- else
- difficulty = nil
- end
- end
- local ready = false
- while not ready do
- while not difficulty do
- term.setCursorPos(1,1)
- term.setTextColor(colors.white)
- print("Difficulty: Easy, Normal, Hard, Custom?")
- difficulty = read():lower()
- if difficulty == "easy" then
- inputWidth = 8
- inputHeight = 8
- inputMines = 10
- elseif difficulty == "normal" then
- inputWidth = 16
- inputHeight = 16
- inputMines = 40
- elseif difficulty == "hard" then
- inputWidth = 32
- inputHeight = 16
- inputMines = 99
- elseif difficulty ~= "custom" then
- difficulty = nil
- term.clear()
- term.setTextColor(colors.orange)
- print("Please set a vaild difficulty.")
- end
- end
- term.clear()
- while not inputWidth do
- term.setCursorPos(1,1)
- term.setTextColor(colors.white)
- print("Input Width of Board")
- inputWidth = tonumber(read():lower())
- if inputWidth == nil then
- inputWidth = nil
- term.clear()
- term.setTextColor(colors.orange)
- print("Please input a valid number.")
- elseif inputWidth <= 3 then
- inputWidth = nil
- term.clear()
- term.setTextColor(colors.orange)
- print("Please input a positive number of at least 4.")
- end
- end
- term.clear()
- while not inputHeight do
- term.setCursorPos(1,1)
- term.setTextColor(colors.white)
- print("Input Height of Board")
- inputHeight = tonumber(read():lower())
- if inputHeight == nil then
- inputHeight = nil
- term.clear()
- term.setTextColor(colors.orange)
- print("Please input a valid number.")
- elseif inputHeight <= 3 then
- inputHeight = nil
- term.clear()
- term.setTextColor(colors.orange)
- print("Please input a positive number of at least 4.")
- end
- end
- local boardArea = inputWidth * inputHeight
- term.clear()
- while not inputMines do
- term.setCursorPos(1,1)
- term.setTextColor(colors.white)
- print("Input Mine Count")
- inputMines = tonumber(read():lower())
- if inputMines == nil then
- inputMines = nil
- term.clear()
- term.setTextColor(colors.orange)
- print("Please input a valid number.")
- elseif inputMines <= 0 or inputMines >= boardArea then
- term.clear()
- term.setTextColor(colors.orange)
- if inputMines <= 0 then
- print("Please input a positive number.")
- elseif inputMines >= boardArea - 8 then
- print("Please input a number lower than the area of the board minus 8.")
- end
- inputMines = nil
- end
- end
- ready = nil
- term.clear()
- while ready == nil do
- term.setCursorPos(1,1)
- term.setTextColor(colors.white)
- print("Review Settings:\n"..inputWidth.."x"..inputHeight.."\n"..inputMines.." Mines.\nDifficulty: "..difficulty:gsub("^%l", string.upper))
- print("Is this correct?")
- ready = read():lower()
- if ready ~= "y" and ready ~= "n" then
- ready = nil
- term.clear()
- term.setTextColor(colors.orange)
- print("Please insert Y or N.")
- elseif ready == "y" then
- ready = true
- boardSettings = {["Width"] = inputWidth, ["Height"] = inputHeight, ["MineCount"] = inputMines, ["EmptySpaces"] = (inputWidth * inputHeight) - inputMines, ["Difficulty"] = difficulty}
- elseif ready == "n" then
- ready = false
- inputMines = nil
- inputWidth = nil
- inputHeight = nil
- difficulty = nil
- term.clear()
- end
- end
- end
- -- Everything above this was literally just giving the settings for the board.
- -- Below is generating the board and everything
- -- jeez
- term.setBackgroundColor(colors.gray)
- term.clear()
- local boardWindow = window.create(term.current(), 1, 2, boardSettings["Width"], boardSettings["Height"])
- local boardWindowSX, boardWindowSY = boardWindow.getSize()
- local bg = term.current()
- local flagged = boardSettings["MineCount"]
- boardWindow.setBackgroundColor(colors.lightGray)
- term.redirect(boardWindow)
- paintutils.drawFilledBox(1,1,boardWindowSX,boardWindowSY)
- local firstMoveForControls = false
- local firstMove = false
- local mineBoard
- local boardWindowX, boardWindowY
- local invertCam
- local exploded = false
- local won = false
- -- Ripped from Roblox Ver. [https://pastebin.com/aNSNrvvF]
- function createBoardArray(startPos, width, height, mineCount)
- --Generating the Array. First step towards the board generation
- local board = {}
- for i = 1, height do
- local newRow = {} -- This is an array for each new row
- for j = 1, width do
- if mineCount > 0 then -- If there is still meant to be mines
- if math.random(1,10) == 1 and not ( -- Go through with RNG.
- (startPos.y == i or (startPos.y + 1 == i or startPos.y - 1 == i)) and
- (startPos.x == j or (startPos.x + 1 == j or startPos.x - 1 == j))) then
- table.insert(newRow,j,10)
- mineCount = mineCount - 1
- else -- If RNG fails, don't place a mine.
- table.insert(newRow,j,0)
- end
- else -- If there shouldn't be anymore mines, just place an empty space
- table.insert(newRow,j,0)
- end
- end
- table.insert(board,i,newRow) -- Insert the generated mode into the board. Repeat this "height" times
- end
- --If there still needs to be mines, it'll create them here.
- while mineCount ~= 0 do
- for n,i in ipairs(board) do
- for m,j in ipairs(board[n]) do
- if board[n][m] ~= 10 and board[n][m] ~= 9 then -- Check if the space is not a mine already
- if math.random(1,15) == 1 and not ( -- If not, go through with RNG. Tougher this time.
- (startPos.y == n or (startPos.y + 1 == n or startPos.y - 1 == n)) and
- (startPos.x == m or (startPos.x + 1 == m or startPos.x - 1 == m))) then
- board[n][m] = 10 -- Replaces board[n][m] with a mine.
- mineCount = mineCount - 1
- end
- end
- if mineCount == 0 then
- break
- end
- end
- if mineCount == 0 then -- Double break because one break only stops part of it
- break
- end
- end
- end
- -- Check for Mines and put numbers next to them
- for n,i in ipairs(board) do
- for m,j in ipairs(board[n]) do
- if board[n][m] == 10 then -- If there is a mine, execute all of the following. Each direction shows where it goes towards below.
- --Left
- if m-1 ~= 0 then
- if board[n][m-1] ~= 10 then
- board[n][m-1] = board[n][m-1] + 1
- end
- end
- --Right
- if m+1 <= width then
- if board[n][m+1] ~= 10 then
- board[n][m+1] = board[n][m+1] + 1
- end
- end
- --Up
- if n-1 ~= 0 then
- if board[n-1][m] ~= 10 then
- board[n-1][m] = board[n-1][m] + 1
- end
- end
- --Down
- if n+1 <= height then
- if board[n+1][m] ~= 10 then
- board[n+1][m] = board[n+1][m] + 1
- end
- end
- --Up Left
- if n-1 ~= 0 and m-1 ~= 0 then
- if board[n-1][m-1] ~= 10 then
- board[n-1][m-1] = board[n-1][m-1] + 1
- end
- end
- --Up Right
- if n-1 ~= 0 and m+1 <= width then
- if board[n-1][m+1] ~= 10 then
- board[n-1][m+1] = board[n-1][m+1] + 1
- end
- end
- --Down Left
- if n+1 <= height and m-1 ~= 0 then
- if board[n+1][m-1] ~= 10 then
- board[n+1][m-1] = board[n+1][m-1] + 1
- end
- end
- --Down Right
- if n+1 <= height and m+1 <= width then
- if board[n+1][m+1] ~= 10 then
- board[n+1][m+1] = board[n+1][m+1] + 1
- end
- end
- end
- end
- end
- return board
- end
- function onUncoverDo(X, Y)
- if X > boardWindowX - 1 and X < boardWindowSX + (boardWindowX) and Y > boardWindowY - 1 and Y < boardWindowSY + (boardWindowY) then
- if not firstMove then
- firstMove = true
- paintutils.drawPixel(X - (boardWindowX - 1), Y - (boardWindowY - 1), colors.black)
- mineBoard = createBoardArray({["y"] = X - (boardWindowX - 1), ["x"] = Y - (boardWindowY - 1)}, boardSettings["Height"], boardSettings["Width"], boardSettings["MineCount"])
- mineBoard[X - (boardWindowX - 1)][Y - (boardWindowY - 1)] = 99
- boardSettings["EmptySpaces"] = boardSettings["EmptySpaces"] - 1
- removeSurround(X, Y)
- elseif mineBoard[X - (boardWindowX - 1)][Y - (boardWindowY - 1)] ~= 99 then
- local spaceToUncover = mineBoard[X - (boardWindowX - 1)][Y - (boardWindowY - 1)]
- boardSettings["EmptySpaces"] = boardSettings["EmptySpaces"] - 1
- if spaceToUncover == 0 then
- paintutils.drawPixel(X - (boardWindowX - 1), Y - (boardWindowY - 1), colors.black)
- mineBoard[X - (boardWindowX - 1)][Y - (boardWindowY - 1)] = 99
- removeSurround(X, Y)
- elseif spaceToUncover == 1 then
- paintutils.drawPixel(X - (boardWindowX - 1), Y - (boardWindowY - 1), colors.blue)
- term.setCursorPos(X - (boardWindowX - 1), Y - (boardWindowY - 1))
- term.write("1")
- mineBoard[X - (boardWindowX - 1)][Y - (boardWindowY - 1)] = 99
- elseif spaceToUncover == 2 then
- paintutils.drawPixel(X - (boardWindowX - 1), Y - (boardWindowY - 1), colors.green)
- term.setCursorPos(X - (boardWindowX - 1), Y - (boardWindowY - 1))
- term.write("2")
- mineBoard[X - (boardWindowX - 1)][Y - (boardWindowY - 1)] = 99
- elseif spaceToUncover == 3 then
- paintutils.drawPixel(X - (boardWindowX - 1), Y - (boardWindowY - 1), colors.orange)
- term.setCursorPos(X - (boardWindowX - 1), Y - (boardWindowY - 1))
- term.write("3")
- mineBoard[X - (boardWindowX - 1)][Y - (boardWindowY - 1)] = 99
- elseif spaceToUncover == 4 then
- paintutils.drawPixel(X - (boardWindowX - 1), Y - (boardWindowY - 1), colors.purple)
- term.setCursorPos(X - (boardWindowX - 1), Y - (boardWindowY - 1))
- term.write("4")
- mineBoard[X - (boardWindowX - 1)][Y - (boardWindowY - 1)] = 99
- elseif spaceToUncover == 5 then
- paintutils.drawPixel(X - (boardWindowX - 1), Y - (boardWindowY - 1), colors.red)
- term.setCursorPos(X - (boardWindowX - 1), Y - (boardWindowY - 1))
- term.write("5")
- mineBoard[X - (boardWindowX - 1)][Y - (boardWindowY - 1)] = 99
- elseif spaceToUncover == 6 then
- paintutils.drawPixel(X - (boardWindowX - 1), Y - (boardWindowY - 1), colors.cyan)
- term.setCursorPos(X - (boardWindowX - 1), Y - (boardWindowY - 1))
- term.write("6")
- mineBoard[X - (boardWindowX - 1)][Y - (boardWindowY - 1)] = 99
- elseif spaceToUncover == 7 then
- paintutils.drawPixel(X - (boardWindowX - 1), Y - (boardWindowY - 1), colors.white)
- term.setCursorPos(X - (boardWindowX - 1), Y - (boardWindowY - 1))
- term.write("7")
- mineBoard[X - (boardWindowX - 1)][Y - (boardWindowY - 1)] = 99
- elseif spaceToUncover == 8 then
- paintutils.drawPixel(X - (boardWindowX - 1), Y - (boardWindowY - 1), colors.gray)
- term.setCursorPos(X - (boardWindowX - 1), Y - (boardWindowY - 1))
- term.write("8")
- mineBoard[X - (boardWindowX - 1)][Y - (boardWindowY - 1)] = 99
- elseif spaceToUncover == 10 then
- paintutils.drawPixel(X - (boardWindowX - 1), Y - (boardWindowY - 1), colors.yellow)
- term.setCursorPos(X - (boardWindowX - 1), Y - (boardWindowY - 1))
- term.setTextColor(colors.black)
- term.write("X")
- term.setTextColor(colors.white)
- mineBoard[X - (boardWindowX - 1)][Y - (boardWindowY - 1)] = 99
- boardSettings["EmptySpaces"] = boardSettings["EmptySpaces"] + 100
- exploded = true
- end
- if boardSettings["EmptySpaces"] == 0 then
- won = true
- end
- end
- end
- end
- function removeSurround(X, Y)
- local m, n = X - (boardWindowX - 1), Y - (boardWindowY - 1)
- --Left
- if m-1 ~= 0 then
- onUncoverDo(X - 1,Y)
- -- mineBoard[n][m-1] = mineBoard[n][m-1] + 1
- end
- --Right
- if m+1 < boardSettings["Width"] + 1 then
- onUncoverDo(X + 1,Y)
- -- mineBoard[n][m+1] = mineBoard[n][m+1] + 1
- end
- --Up
- if n-1 ~= 0 then
- onUncoverDo(X,Y - 1)
- -- mineBoard[n-1][m] = mineBoard[n-1][m] + 1
- end
- --Down
- if n+1 <= boardSettings["Height"] + 1 then
- onUncoverDo(X,Y + 1)
- -- mineBoard[n+1][m] = mineBoard[n+1][m] + 1
- end
- --Up Left
- if n-1 ~= 0 and m-1 ~= 0 then
- onUncoverDo(X - 1,Y - 1)
- --mineBoard[n-1][m-1] = mineBoard[n-1][m-1] + 1
- end
- --Up Right
- if n-1 ~= 0 and m+1 <= boardSettings["Width"] + 1 then
- onUncoverDo(X + 1,Y - 1)
- -- mineBoard[n-1][m+1] = mineBoard[n-1][m+1] + 1
- end
- --Down Left
- if n+1 <= boardSettings["Height"] + 1 and m-1 ~= 0 then
- onUncoverDo(X - 1,Y + 1)
- -- mineBoard[n+1][m-1] = mineBoard[n+1][m-1] + 1
- end
- --Down Right
- if n+1 <= boardSettings["Height"] + 1 and m+1 <= boardSettings["Width"] + 1 then
- onUncoverDo(X + 1,Y + 1)
- -- mineBoard[n+1][m+1] = mineBoard[n+1][m+1] + 1
- end
- end
- local eggDeathMessage
- local deathMessage = math.random(1,24)
- if deathMessage == 2 then
- eggDeathMessage = math.random(1,6)
- end
- local winMessage = math.random(1,8)
- local eggWinMessage
- if winMessage == 3 then
- eggWinMessage = math.random(1,2)
- end
- while true do
- if firstMoveForControls == false then
- term.redirect(bg)
- term.setBackgroundColor(colors.blue)
- term.setCursorPos(1,1)
- print("Flagged:",flagged)
- print("Controls:")
- print("WASD to move the board/camera")
- print("Mouse1 to Uncover")
- print("Mouse2 to Flag")
- print("I to invert camera controls")
- print("H to bring this up again")
- term.redirect(boardWindow)
- elseif exploded == true then
- term.redirect(bg)
- term.setBackgroundColor(colors.gray)
- term.clear()
- boardWindow.redraw()
- term.setBackgroundColor(colors.blue)
- term.setCursorPos(1,1)
- if deathMessage == 1 then
- print("F")
- elseif deathMessage == 2 then
- if eggDeathMessage == 1 then
- print("You are ded. Not big soup rice.")
- elseif eggDeathMessage == 2 then
- print("If you were from, where I was from, you'd be frickin' dead.")
- elseif eggDeathMessage == 3 then
- print("We're done for, everyone, get out!")
- elseif eggDeathMessage == 4 then
- print("Use a flag. And if that don't work, use more flag.")
- elseif eggDeathMessage == 5 then
- print("Get dunked on.")
- elseif eggDeathMessage == 6 then
- print("/kill @p")
- end
- elseif deathMessage == 3 then
- print("L")
- elseif deathMessage == 4 then
- print("The player is gone!")
- elseif deathMessage == 5 then
- print("DeathMessage5.png")
- elseif deathMessage == 6 then
- print("Failed!")
- elseif deathMessage == 7 then
- print("So close, yet so far.")
- elseif deathMessage == 8 then
- print("Watch out, a 50/50 behind you!")
- elseif deathMessage == 9 then
- print("i ran out of ideas for messages")
- elseif deathMessage == 10 then
- print("Oof")
- elseif deathMessage == 11 then
- if boardSettings["Difficulty"] == "easy" then
- print("Failed... on easy?")
- elseif boardSettings["Difficulty"] == "normal" then
- print("You can do it on normal.")
- elseif boardSettings["Difficulty"] == "hard" then
- print("Hard is pretty difficult, just saying.")
- elseif boardSettings["Difficulty"] == "custom" then
- print("Did you fail a 50x50 1 mine, or 50x50 512? I can't tell")
- end
- elseif deathMessage == 12 then
- if boardSettings["Difficulty"] == "easy" then
- print("We all make mistakes...")
- elseif boardSettings["Difficulty"] == "normal" or boardSettings["Difficulty"] == "custom" then
- print("You got this.")
- elseif boardSettings["Difficulty"] == "hard" then
- print("Difficulty comes with mistakes")
- end
- elseif deathMessage == 13 then
- print("HP: 0 / 1")
- elseif deathMessage == 14 then
- print("Well, you tried, and that's all that matters.")
- elseif deathMessage == 15 then
- print("a")
- elseif deathMessage == 16 then
- print("dddddddwwwwwwwaaaaaaaaaaa")
- elseif deathMessage == 17 then
- print("I can't even right now.")
- elseif deathMessage == 18 then
- print("OMEGALUL")
- elseif deathMessage == 19 then
- print("Up up down down left- wait this isn't a controller.")
- elseif deathMessage == 20 then
- print("Explosion not included.")
- elseif deathMessage == 21 then
- print("local plr = nil")
- elseif deathMessage == 22 then
- print("plr.Exploded = true")
- elseif deathMessage == 23 then
- print("boardSettings[\"Difficulty\"] = "..boardSettings["Difficulty"])
- elseif deathMessage == 24 then
- print("*clap* *clap* Good job, not really.")
- end
- term.redirect(boardWindow)
- elseif won == true then
- term.redirect(bg)
- term.setBackgroundColor(colors.gray)
- term.clear()
- boardWindow.redraw()
- term.setBackgroundColor(colors.blue)
- term.setCursorPos(1,1)
- if winMessage == 1 then
- print("GG")
- elseif winMessage == 2 then
- print("I knew you could do it.")
- elseif winMessage == 3 then
- if eggWinMessage == 1 then
- print("Mission Passed!\n+ Respect")
- elseif eggWinMessage == 2 then
- print("You've done me proud boys")
- end
- elseif winMessage == 4 then
- print("*pop* Noice.")
- elseif winMessage == 5 then
- print("Haha, you- wait you actually won?")
- elseif winMessage == 6 then
- if boardSettings["Difficulty"] == "easy" then
- print("Onto Normal!")
- elseif boardSettings["Difficulty"] == "normal" then
- print("Onto Hard!")
- elseif boardSettings["Difficulty"] == "hard" then
- print("Beating hard is a milestone.")
- elseif boardSettings["Difficulty"] == "custom" then
- print("Onto- wait you're on custom.")
- end
- elseif winMessage == 7 then
- print("owo")
- elseif winMessage == 8 then
- print("Welcome to victory.")
- end
- else
- term.redirect(bg)
- term.setBackgroundColor(colors.gray)
- term.clear()
- boardWindow.redraw()
- term.setBackgroundColor(colors.blue)
- term.setCursorPos(1,1)
- print("Flagged:",flagged)
- term.redirect(boardWindow)
- end
- boardWindowX, boardWindowY = boardWindow.getPosition()
- local event, key, X, Y = os.pullEvent()
- if event == "key" then
- firstMoveForControls = true
- if key == keys.w then
- term.redirect(bg)
- term.setBackgroundColor(colors.gray)
- term.clear()
- term.redirect(boardWindow)
- term.setBackgroundColor(colors.lightGray)
- if invertCam then
- boardWindow.reposition(boardWindowX, boardWindowY + 1)
- else
- boardWindow.reposition(boardWindowX, boardWindowY - 1)
- end
- elseif key == keys.a then
- term.redirect(bg)
- term.setBackgroundColor(colors.gray)
- term.clear()
- term.redirect(boardWindow)
- term.setBackgroundColor(colors.lightGray)
- if invertCam then
- boardWindow.reposition(boardWindowX + 1, boardWindowY)
- else
- boardWindow.reposition(boardWindowX - 1, boardWindowY)
- end
- elseif key == keys.s then
- term.redirect(bg)
- term.setBackgroundColor(colors.gray)
- term.clear()
- term.redirect(boardWindow)
- term.setBackgroundColor(colors.lightGray)
- if invertCam then
- boardWindow.reposition(boardWindowX, boardWindowY - 1)
- else
- boardWindow.reposition(boardWindowX, boardWindowY + 1)
- end
- elseif key == keys.d then
- term.redirect(bg)
- term.setBackgroundColor(colors.gray)
- term.clear()
- term.redirect(boardWindow)
- term.setBackgroundColor(colors.lightGray)
- if invertCam then
- boardWindow.reposition(boardWindowX - 1, boardWindowY)
- else
- boardWindow.reposition(boardWindowX + 1, boardWindowY)
- end
- elseif key == keys.h then
- firstMoveForControls = false
- elseif key == keys.i then
- if invertCam then
- invertCam = false
- else
- invertCam = true
- end
- end
- elseif event == "mouse_click" then
- firstMoveForControls = true
- if key == 1 then
- onUncoverDo(X,Y)
- elseif key == 2 then
- if mineBoard ~= nil then
- if X > boardWindowX - 1 and X < boardWindowSX + (boardWindowX) and Y > boardWindowY - 1 and Y < boardWindowSY + (boardWindowY) then
- spaceToFlag = mineBoard[X - (boardWindowX - 1)][Y - (boardWindowY - 1)]
- if (spaceToFlag > 10 or spaceToFlag == 9) and spaceToFlag ~= 99 then
- paintutils.drawPixel(X - (boardWindowX - 1), Y - (boardWindowY - 1), colors.lightGray)
- flagged = flagged + 1
- if spaceToFlag ~= 9 then
- mineBoard[X - (boardWindowX - 1)][Y - (boardWindowY - 1)] = mineBoard[X - (boardWindowX - 1)][Y - (boardWindowY - 1)] - 10
- else
- mineBoard[X - (boardWindowX - 1)][Y - (boardWindowY - 1)] = 0
- end
- elseif spaceToFlag ~= 99 then
- paintutils.drawPixel(X - (boardWindowX - 1), Y - (boardWindowY - 1), colors.red)
- flagged = flagged - 1
- if spaceToFlag == 0 then
- mineBoard[X - (boardWindowX - 1)][Y - (boardWindowY - 1)] = 9
- else
- mineBoard[X - (boardWindowX - 1)][Y - (boardWindowY - 1)] = spaceToFlag + 10
- end
- end
- end
- end
- end
- end
- end
- --[[
- Thank you dan200 for creating this mod.
- If it weren't for your mod,
- I wouldn't know what I would be doing.
- This is my second largest project here,
- and my first was years ago.
- Thanks for your work.
- - Null_Cat
- ]]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement