Commits

Author Commit Message Labels Comments Date
zck
For last checkin, forgot to save the last changes.
zck
Added 'minesweeper-choose-around, which picks the eight squares around point. I had to slightly rework 'pick to throw when the game ends, so ending the game by choosing-around won't pick into the new game, if the user decides to start a new game.
zck
Bind b, f, n, p to movement keys.
zck
Made minesweeper-pick iterative rather than recursive. Now it won't have too deep a stack.
zck
Whoo! Now, the code prompts for height, width, and number of mines. It still needs to be refactored slightly, and I'd like to make it so you don't have to delete the default value that it prompts you with.
zck
Added colors for squares.
zck
Changed the characters for marked cells to *, and unmarked unrevealed cells to -.
zck
Squares can be marked, causing them to not be revealable until they are unmarked.
zck
The text of lose-game now asks if you want to start another game.
zck
changed debug to minesweeper-debug, for to minesweeper-for.
zck
Reordered lines to not clear local variables until after switching to buffer "minesweeper".
zck
Changed instances of 'map to 'mapcar; I don't know why they were there in the first place. Also fixed minesweeper-move-away bug where 0 would be stored in the minefield instead of ?0, 1 instead of ?1, etc., to replace the mine that was moved away.
zck
Added 'minesweeper-begin-game, which simply calls 'minesweeper-init and 'minesweeper-print-field. In win-game and lose-game, prompt for a new game, and start one if requested.
zck
We no longer suffer under the reign of derived-mode. We are our own mode! Also, keep track of how many wins and losses the player has, and remind them how awful they are when they win or lose.
zck
Switch to a buffer called "minesweeper" when starting the game.
zck
Found out about 'line-number-at-pos, which returns the current line number! Yay! Also found out about 'number-to-string, which helped me shorten a lot of my debug statements.
zck
Renamed minesweeper-mode.lisp to minesweeper-mode.el
zck
Actually put in the right file for the commit.
zck
Added 'minesweeper-insert-mines, 'minesweeper-move-mine-away functions.
zck
Aha! Fixed bug -- 'minesweeper-fill-field wasn't checking correctly for inserting a mine on top of a previous mine, as it was calling (minesweeper-view-mine x y), not (minesweeper-view-mine x y 't). Duh. Also, set the major mode and major mode name correctly.
zck
Now the spacebar, x key, and return key all call 'minesweeper-choose appropriately! Woohoo!
zck
Changed 'forward-line to 'next-line. For some reason, there's a bug that puts "Beginning of buffer" in the modeline when I try to select a mine. Not sure why...
zck
After choosing a spot, point is put back at the chosen spot.
zck
Properly defined 'minesweeper-mode-map. 'minesweeper-pick checks bounds. 'minesweeper-choose is new, and is the user-facing function to pick a spot. 'minesweeper-lose-game now prints the lose message out after printing the field. 'minesweeper-current-line returns the current line -- I can't find a better way to do this, but there must be one.
zck
Moved 'erase-buffer and 'minesweeper-print-field from 'minesweeper-init to 'minesweeper-mode. Also, changed 'minesweeper-mines-left to 'minesweeper-blanks-left, to actually indicate what it is. Also, track when the user picks a mine on eir first move, and reset the game board. Put 'debug around 'pick-around-helper's 'insert.
zck
Set max-lisp-eval-depth to a high enough value to let this code run. Also, debugging stuff.
zck
Comment about deep recursion. Currently, if you try to 'minesweeper-pick a 0 in a sparse section, you only reveal a few dozen other 0 cells before Emacs cuts off the recursion. This needs to be fixed. I attempted with 'minesweeper-alternate-pick, but that isn't working yet. It loops forever, which is awesome.
zck
Removed some dead code.
zck
Added default values for height, width, #mines. Added mines-left variable to track when the game is ongoing.
zck
Added 'minesweeper-is-revealed, 'minesweeper-pick, 'minesweeper-pick-around, 'minesweeper-end-game. They mostly work -- there's a random case that blows the stack, but I'm not sure what it is yet.
  1. Prev
  2. Next