-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
0 parents
commit 4ccf752
Showing
143 changed files
with
2,477 additions
and
0 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
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 added
BIN
+524 Bytes
out/production/Minesweeper2/Minesweeper/MinesweeperGame$Range.class
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |
Oops, something went wrong.