Skip to content

Commit

Permalink
ini
Browse files Browse the repository at this point in the history
edwardx999 committed Mar 11, 2018
0 parents commit 4ccf752
Showing 143 changed files with 2,477 additions and 0 deletions.
674 changes: 674 additions & 0 deletions LICENSE.MD

Large diffs are not rendered by default.

17 changes: 17 additions & 0 deletions README.MD
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Old project from High School.
Minesweeper that plays twelve-tone "music."

Copyright (C) 2017 Edward Xie

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Binary file added fonts/digital7.ttf
Binary file not shown.
Binary file added images/cursor1600.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/cursorsquare.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/ded.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/eig.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/fiv.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/flg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/fou.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/hap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/mine.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/one.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/sad.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/sev.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/six.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/sup.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/thr.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/tinycursor.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/two.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/win.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/wrong.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/zer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images3/ded.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images3/eig.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images3/fiv.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images3/flg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images3/fou.png
Binary file added images3/hap.png
Binary file added images3/icon.png
Binary file added images3/mine.png
Binary file added images3/one.png
Binary file added images3/sad.png
Binary file added images3/sev.png
Binary file added images3/six.png
Binary file added images3/sup.png
Binary file added images3/thr.png
Binary file added images3/two.png
Binary file added images3/win.png
Binary file added images3/wrong.png
Binary file added images3/zer.png
Binary file added lib/OpenAL64.dll
Binary file not shown.
Binary file added lib/lwjgl.jar
Binary file not shown.
Binary file added lib/lwjgl64.dll
Binary file not shown.
Binary file added lib/lwjgl_util.jar
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
66 changes: 66 additions & 0 deletions src/Minesweeper/Board.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
/*
Copyright(C) 2017 Edward Xie
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package Minesweeper;

import javax.swing.border.Border;

/**
*
* @author xieedwa
* @param <OnBoard> the type of piece that goes on the board
*/
public class Board<OnBoard> {

// static final Color DEFAULT_COLOR1=new Color(255,228,196);
// static final Color DEFAULT_COLOR2=new Color(205,133,63);
// static final Color DEFAULT_HIGHLIGHT_COLOR=new Color(171,205,239);
TileButton<OnBoard>[][] board;//board of buttons [x][y]

//constructor
public Board(int width,int height) {
board=new TileButton[width][height];
initBoard();
}

public TileButton<OnBoard>[][] getBoard() {//returns board array
return board;
}

public TileButton<OnBoard> getTile(int x,int y) {//gets a tile
return board[x][y];
}

public void initBoard() {//initializes board
for(int c=0;c<board.length;++c)
for(int r=0;r<board[0].length;++r)
board[c][r]=new TileButton();
}

public void setTileEntity(int x,int y,OnBoard entity) {//changes entity on board
board[x][y].setEntity(entity);
}

public void setTileBorder(int x,int y,Border border) {//changes the border of a tile
board[x][y].setBorder(border);
}

public void setAllBorders(Border border) {//changes all borders of buttons
for(int r=0;r<board.length;++r)
for(int c=0;c<board[0].length;++c)
board[r][c].setBorder(border);
}
}
73 changes: 73 additions & 0 deletions src/Minesweeper/MineTile.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
/*
Copyright(C) 2017 Edward Xie
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package Minesweeper;

import javax.swing.ImageIcon;

/**
*
* @author xieedwa
*/
public class MineTile {

private int number;//number of mines adjacent, -1 is a mine
private ImageIcon image;//image used when revealed
private boolean revealed;//whether tile is revealed
private boolean flagged;//whether mine is flagged

//constructors
public MineTile(int number,ImageIcon image) {
this.number=number;
setImage(image);
}

public MineTile(int number) {
this(number,null);
}

public void setImage(ImageIcon image) {//changes image of tile
this.image=image;
}

public int getNumberOfMines() {//returns mine number
return number;
}

public void setNumberOfMines(int number) {//assigns mine number
this.number=number;
}

public ImageIcon getImage() {//returns mine image
return image;
}

public boolean isRevealed() {//returns whether tile has been revealed
return revealed;
}

public void setRevealed(boolean revealed) {//changes reveal state of mine
this.revealed=revealed;
}

public void setFlagged(boolean flagged) {//changes flagged state
this.flagged=flagged;
}

public boolean isFlagged() {//returns whether tile is flagged
return flagged;
}
}
Loading

0 comments on commit 4ccf752

Please sign in to comment.