Christopher Beech

Ranch Hand
+ Follow
since Feb 08, 2006
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Christopher Beech

That might help when the correct variable reaches the validMove mehtod. The problem is that the validMove method always gets piece as null. Since it doesn't match any of the strings, it treats the piece as a king.
14 years ago
I'm having some trouble with a chess program. My validMove method does not work correctly. It's forcing all the pieces to move like a king. I think it has something to do with the way I'm passing String piece to the function, but everything I have tried to fix it has not worked.

14 years ago
My mistake. It's an NoSuchElementException.

And here's the error lines it's giving me:

NoSuchElementException: No line found
at java.util.Scanner.nextLine(Unknown Source)
at Japanese.<init>(Japanese.java:24)
at JapaneseDirTester.main(JapaneseDirTester.java:23)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)

Nevermind. I figured out that the error was caused because I had an odd number of words in the file.

Any clue why my remove method is always removing the second line???
And why is it reading in the file last line first???
[ April 15, 2007: Message edited by: Christopher Beech ]

[ April 15, 2007: Message edited by: Christopher Beech ]

[ April 15, 2007: Message edited by: Christopher Beech ]
[ April 15, 2007: Message edited by: Christopher Beech ]
16 years ago
Not sure if this is the right forum for this or not. I'm trying to type up a program that will help me study japanese. It takes in a text file and does various things with the file. But for some reason, I keep getting a "No Line Found" error. I've been using Java since Spring of 2005 and I believe that this is the first time I've ever encounter this error.

Here's the code I'm using.

Disclaimer: I didn't type up the JapaneseDirTester program. I modified a file I got from the Data Structures And Algorthims class I was in Spring of 2006.









Here's the contents of the file I'm trying to read in:

neko
cat
neko
student
gakusee
um
ano
now
ima
yes
ee
English language
eego
phone
denwa
[ April 15, 2007: Message edited by: Christopher Beech ]
16 years ago
Wow. Almost no replies. I guess I should have known better than to expect help from an internet forum.

Thanks to the few that bother to help.
16 years ago
Anybody got an idea how to get the min-winner??? I've been at it all night but I've haven't gotten it yet.
17 years ago
I've made some changes. I know that it will, at the very least, insert numbers in the correct order. If I could just get that compare to work.

17 years ago
It's expecting an int to be returned. But I'm not sure what int to return. I could put return smaller at the very end. That'll make the compiler happy, but I doubt it'll do any more than that.
17 years ago
New error found.


Missing return statement
17 years ago
Ok, did a little changing. Here's what I changed:



The compiler is having a fit over the following line:

h.compare();
Error: compare(Node) in Tournament cannot be applied to ();
[ March 27, 2007: Message edited by: Christopher Beech ]
17 years ago
Greetings, Java Ranch

I'm trying to type up a program that will generate sorted runs that are greater than the size of memory. The momory can hold a tournament tree with 4 elements. I have 16 elements to put in. It's suppose to take the 4 ints, do a min winner tree, toss the winner into an array, remove the winner from the tree, then insert a new given element. Program compares tree elements to the last int in the winner array. If the tree element is smaller than the last array in winner, it is ignored. Whenever all the tree elements are smaller than the last int in the winner array, the winner array is printed. The entire winner array is then erased.

Sorry if my code is a little funny. I've done most of the typing while sick.



Also, these three lines are giving the complier a fit:



[ March 27, 2007: Message edited by: Christopher Beech ]
[ March 27, 2007: Message edited by: Christopher Beech ]
17 years ago
Hello, Java Ranch.

Got to make an assembler for a class. Programming in Java since it's the language I know best. This thing has got me very confused.



Questions:

Does java know the Pseudoinstruction table?
Does it know the Instruction table?
What would be the easiest way to open the file and store the assembly data?
Array?
Is there an instruction in Java to translate user-defined address symbols to their decimal equivalent value?
17 years ago
I think I just realized my mistake. A quick question to make sure.


This code should handle all cases where ch is a number, right??? Assumimg that is correct, if ch gets past the above code, it had to be an operator.

Am I on the right track here???

This would mean I need to put something else in the () for the else if statement.
[ April 18, 2006: Message edited by: Christopher Beech ]
17 years ago
The purpose of that line is to check if the ch is an operator.
17 years ago