- Upvotes Received
- 0
- Posts with Upvotes
- 0
- Upvoting Members
- 0
- Downvotes Received
- 1
- Posts with Downvotes
- 1
- Downvoting Members
- 1
[CODE]public class TicTacToe3 { public static void main(String[] args){ } int input = 0, turn = 0, mov = 0; String sq1; int[][] table = new int[3][3]; int play; public void table() { for (int row=0; row < 3; row++) for (int col=0; col < 3; col++) table[row][col] = ((row … |
|
[CODE] public class TicTacToeGame { public static final int board_size = 3; // number of rows or columns in the board public static void main(String[] args) { char board[][] = new char[board_size][board_size]; // the game board TicTacToeGame p1 = new TicTacToeGame(); // create the players TicTacToeGame p2 = new TicTacToeGame(); … |
|
[code] import java.util.*; public class Homework11 { Scanner input = new Scanner(new File("keyvalues.txt")); Map<String, Integer> wordCountMap = getCountMap(in); for (String word: wordCountMap.keySet()) { int count = wordCountMap.get(word); while (input.hasNextLine()) { line = input.nextLine(); numLine++; Scanner word = new Scanner(line); while (word.hasNext()){ String nextWord = word.next(); numWord++; numChar = numChar + … |
|
[CODE] public class TicTacToeGame { public static final int board_size = 3; // number of rows or columns in the board public static void main(String[] args) { char board[][] = new char[board_size][board_size]; // the game board TicTacToeGame p1 = new TicTacToeGame(); // create the players TicTacToeGame p2 = new TicTacToeGame(); … |
|
import java.awt.*; import java.awt.event.*; import javax.swing.*; public class TicTacToeV1 implements ActionListener { /*Instance Variables*/ private JFrame window = new JFrame("Tic-Tac-Toe"); private JButton button1 = new JButton(""); private JButton button2 = new JButton(""); private JButton button3 = new JButton(""); private JButton button4 = new JButton(""); private JButton button5 = new JButton(""); … |
|
import java.io.*; import java.util.*; public class Reverseing { public static void main(String[] args) throws Exception { File f = new File("backwards.txt"); Scanner finput = new Scanner(f); String sentence = "", s = "", r = ""; while(finput.hasNext()) { sentence = s + finput.nextLine(); } ArrayList<String> lines = new ArrayList<String>(); ArrayList<String> … |
|
import java.util.*; public class KeywordSearch { Scanner input = new Scanner(new File("keyvalues.txt")); Map<String, Integer> wordCountMap = getCountMap(in); for (String word: wordCountMap.keySet()) { int count = wordCountMap.get(word); while (input.hasNextLine()) { line = input.nextLine(); numLine++; Scanner word = new Scanner(line); while (word.hasNext()){ String nextWord = word.next(); numWord++; numChar = numChar + nextWord.length(); … |
|
import java.util.*; public class Dice { public static void main(String[] args) { String strInput; Scanner console = new Scanner(System.in); System.out.print(" Please enter desired sum: "); do { Random r = new Random(); int count = 0; int dice1 = 0; int dice2 = 0; a = random number; b = … |
|
it works but instead of it reverseing the characters i want it to do this "This is a test.” should be reversed to read: “test. a is This” i want it to do all this in a text file [code]import java.io.*; import java.util.*; public class reverse{ public static void main(String[] … |