#1
Posted 18 January 2013 - 12:16 AM
I decided to work on something quick and easy tonight, to take a break from big projects that require lots of planning and design and etc, so I did something I've meant to do for a while: I threw together Minesweeper!
Requires an advanced computer or monitor; if there's an advanced monitor attached you can run it from a basic computer, tho an advanced computer is recommended for the right-clicking. On a monitor, you switch between showing and flagging a tile by clicking the show/flag button at the top-right.
Two convenience dealies: left-click (or click in "show" mode) a tile that is already revealed and if the number of flags around it equals it's count of mines, all the non-flagged tiles are revealed. (This is like clicking left and right buttons together in windows minecraft). Right-click has the opposite, if the number of unrevealed neighbors equals the count, then they are all flagged. If you care about speed, learn to use these two to your full advantage!
If you play on a single advanced monitor, you will only be able to play easy or medium; the hard board won't fit. It takes an advanced computer or a 2x2 advanced monitor to play hard.
(note to lyqyd: no window_resize event handleing - yet!)
pastebin get nsKrHTbN minesweep
#2
Posted 18 January 2013 - 12:21 AM
#3
Posted 18 January 2013 - 04:20 AM
Very nice btw.
When you lose, could you make it show all the mines?
#4
Posted 18 January 2013 - 04:33 AM
#5
Posted 18 January 2013 - 07:11 AM
#6
Posted 18 January 2013 - 07:20 AM
GopherAtl, on 18 January 2013 - 12:16 AM, said:
GopherAtl, on 18 January 2013 - 12:16 AM, said:
Looks excellent, Gopher! Perhaps version 2.0 could also make use of the grey colors instead of black and white for revealed/hidden tiles.
#7
Posted 18 January 2013 - 07:28 AM
re: window resize events, it'd be a lot easier to handle if there were a way to set the minimum size it can resize to basically going to have to write it to use my gui code, or re-implement scrollable client areas with scroll bars, to make it properly work with resizing windows. Of course, scroll bars would let you do larger maps, and all maps even on a single monitor, so might be worth doing that anyway. I don't like the idea of adding dependencies to this project, tho, I deliberately did it without them. Ah well. 2.0 will probably be a while.
#8
Posted 18 January 2013 - 07:46 AM
DUN DUN DUN!!
Either way, It looks nice Gopher! Excellent work.
#9
Posted 18 January 2013 - 02:00 PM
if x~=x2 or y~=y2 then
func(x2,y2)
end
Would have thought it would've been a x ~= x2 and y ~= y2
#10
Posted 18 January 2013 - 02:05 PM
#11
Posted 18 January 2013 - 02:56 PM
Don't you have to confirm that x2 and y2 are both not x and y, else x2 might be x and y not be y2 and it still fail?
#12
Posted 18 January 2013 - 03:09 PM
Also, updated version. Timer, mine count, and a new feature.where right-click on a revealed number to auto-flag neighbors when the number of hidden tiles around it is is equal to the count. Ex, if there's only 2 unrevealed tile left by a "2", right-click the 2 and it is flagged.
#13
Posted 18 January 2013 - 08:22 PM
#14
Posted 18 January 2013 - 08:43 PM
#15
Posted 19 January 2013 - 01:49 AM
#16
Posted 19 January 2013 - 03:02 AM
GopherAtl, on 18 January 2013 - 07:28 AM, said:
Wouldn't it be better to implement the scrollbars in LyqydOS, not in each client separately? Or maybe that's what you meant...
Maybe LOS should offer something like term.setSize(x,y), and add scrollbars to the window as needed.
#17
Posted 19 January 2013 - 10:48 AM
#18
Posted 20 January 2013 - 06:32 AM
#19
Posted 20 January 2013 - 12:07 PM
#20
Posted 06 March 2015 - 12:04 PM
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users