This file contains hidden or 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
| import javax.swing.*; | |
| import java.awt.*; | |
| import java.awt.event.ActionEvent; | |
| import java.awt.event.ActionListener; | |
| public class App extends JFrame implements ActionListener { | |
| private int width = 30, height = 30; | |
| private Vigenere cipher = new Vigenere(); | |
| private JTextField keyField; |
This file contains hidden or 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
| public class Vigenere { | |
| private final int SIZE = 26; | |
| private final int BASE = 65; | |
| private char[][] cryptex = new char[SIZE][SIZE]; | |
| // constructors ======================================================== | |
| public Vigenere() { | |
| // generate Vigenere cryptex | |
| for (int row = 0; row < SIZE; row++) { |
This file contains hidden or 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
| import java.util.Random; | |
| public class NumberGame { | |
| private Random rand = new Random(); | |
| private int min, max; | |
| private int num1, num2; | |
| public NumberGame(int min, int max) { | |
| this.min = min; | |
| this.max = max; |
This file contains hidden or 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
| import javax.swing.*; | |
| import java.awt.*; | |
| import java.awt.event.ActionEvent; | |
| import java.awt.event.ActionListener; | |
| public class App extends JFrame implements ActionListener { | |
| /* Canvas ============================================ */ | |
| private NumberGame numbers; | |
| private Font mainFont = new Font(Font.SANS_SERIF, Font.PLAIN,16); |
This file contains hidden or 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
| import javax.swing.*; | |
| import java.awt.*; | |
| public class App extends JFrame { | |
| // declare a new container to get the content pain | |
| Container window = getContentPane(); | |
| /* Set Fonts and Colors ======================================= */ | |
This file contains hidden or 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
| public class Hero { | |
| // class constants ----------------------- | |
| private final int GREEN = 1; | |
| private final int BLUE = 5; | |
| private final int RED = 20; | |
| private final int SILVER= 100; | |
| // data section =========================== | |
| private String name; |
This file contains hidden or 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
| import java.util.Random; | |
| import java.util.Scanner; | |
| public class Main { | |
| static final String BORDER = "==================="; | |
| static final String SUB_MENU = "----------------------"; | |
| public static void main(String[] args) { | |
| // write your code here | |
| Scanner in = new Scanner(System.in); |
This file contains hidden or 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
| import java.util.Random; | |
| import java.util.Scanner; | |
| public class Main { | |
| static final String BORDER = "==================="; | |
| public static void main(String[] args) { | |
| // write your code here | |
| Random rand = new Random(); | |
| Scanner in = new Scanner(System.in); |