No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
The first block is all of my methods and stuff and the second block is just the driver. i'm trying to get it to ask the user if it wants to repeat the whole thing again, but it only works with the last 2 choices [CODE]import java.util.*; public class methodsForTest … |
|
this is my java code that i'm experimenting with right now. trying to learn graphics. [CODE]import java.applet.*; import java.awt.*; public class game extends Applet { Image dbz; public void init() { Font newFont = new Font("TimesRoman", Font.BOLD + Font.ITALIC, 50); setFont(newFont); dbz = getImage(getCodeBase(), "dbz.jpeg"); } public void paint(Graphics g) … |
|
nevermind. it's 6:30 and i forgot to save the class file in the same place. :||||||||||| |
|
[CODE]import java.applet.*; import java.awt.*; import javax.swing.*; public class draw extends Applet { public void delay() { try { Thread.sleep(1); // do nothing for 1000 miliseconds (1 second) } catch(InterruptedException e) { e.printStackTrace(); } } public void paint(Graphics g) { //Timer delay = new Timer() for(int i = 0; i < … |
|
i need a simple way to slow down a for loop using a simple timer-like method. i know for a fact that there is one, because i used it in high school, i just can't remember the code. |
|
[CODE]import java.util.Scanner; public class ticTacToe { public static char[][] board = new char[3][3]; public static getMove(int turnNumber) { char choice = ' '; if (turnNumber % 2 == 1) { //x's turn System.out.println("X's Turn."); char choice = 'x'; System.out.println("Which row and column would you like to choose? (enter number for … |
|
i really need help with this error. it is an unexpected types error [CODE]public class ticTacToeDemo { //use a 3X3 array for the game board. private static char[][] board = new char[3][3]; public static void main(String[] args) { int turnNumber = 0; System.out.println(board[1][1]); newGame(); while(!winner()) { turnNumber += 1; if … |