Results 1 to 12 of 12
Thread: HELP!!!!! SimpleNIM game
- 10-25-2011, 06:50 PM #1
Member
- Join Date
- Oct 2011
- Posts
- 34
- Rep Power
- 0
- 10-25-2011, 07:09 PM #2
Member
- Join Date
- Oct 2011
- Posts
- 83
- Rep Power
- 0
Re: HELP!!!!! SimpleNIM game
Read what the errors are telling you. "Player cannot be resolved to a type". "SimpleNIM cannot be resolved to a type". For some reason, the classes Player and SimpleNIM are not visible to your program. Did you include them in your project properly?
- 10-25-2011, 07:24 PM #3
Member
- Join Date
- Oct 2011
- Posts
- 34
- Rep Power
- 0
Re: HELP!!!!! SimpleNIM game
I CANNOT alter the simpleNIM class, it was given and has to be used as-is.
- 10-25-2011, 07:37 PM #4
Member
- Join Date
- Oct 2011
- Posts
- 90
- Rep Power
- 0
Re: HELP!!!!! SimpleNIM game
He's not suggesting you do. He's saying that the code you wrote can't see the simpleNIM class and the getsticks variable, wherever that may be.
- 10-25-2011, 07:48 PM #5
Member
- Join Date
- Oct 2011
- Posts
- 34
- Rep Power
- 0
Re: HELP!!!!! SimpleNIM game
OKAY. I included it so it now at least sees the player and simpleNIM classes, but new problem. It still cannot see the sticksLeft variable.
- 10-25-2011, 07:50 PM #6
Member
- Join Date
- Oct 2011
- Posts
- 90
- Rep Power
- 0
Re: HELP!!!!! SimpleNIM game
OK, so I don't know where that variable is declared. I don't see it in the code you provided. Where so it?
- 10-25-2011, 08:01 PM #7
Member
- Join Date
- Oct 2011
- Posts
- 34
- Rep Power
- 0
Re: HELP!!!!! SimpleNIM game
aaaaaaaaaa
Last edited by scd250; 10-26-2011 at 05:16 AM.
- 10-25-2011, 08:07 PM #8
Member
- Join Date
- Oct 2011
- Posts
- 90
- Rep Power
- 0
Re: HELP!!!!! SimpleNIM game
OK, I see what's happening here. It is an easy fix. Take a look at the getSticksLeft() accessor method. Pay attention to what parameters it takes and what it returns. Now take a look at how you are calling it in your code. See it?
- 10-25-2011, 08:15 PM #9
Member
- Join Date
- Oct 2011
- Posts
- 34
- Rep Power
- 0
Re: HELP!!!!! SimpleNIM game
edited for finish
Last edited by scd250; 10-30-2011 at 05:58 AM.
- 10-25-2011, 08:19 PM #10
Member
- Join Date
- Oct 2011
- Posts
- 83
- Rep Power
- 0
Re: HELP!!!!! SimpleNIM game
You don't return anything from that method. You calculate bestMove, but you don't return it. Replace each instance of "bestMove = [some number];" with "return [some number];".
- 10-25-2011, 08:19 PM #11
Member
- Join Date
- Oct 2011
- Posts
- 90
- Rep Power
- 0
Re: HELP!!!!! SimpleNIM game
Don't worry...that's progress. The error is telling you exactly what's wrong. whatever calls the method bestMove is expecting it to return a value. Your code determines what that value should be, but you don't do anything with it.
- 10-25-2011, 08:25 PM #12
Member
- Join Date
- Oct 2011
- Posts
- 34
- Rep Power
- 0
Similar Threads
-
Complete Game Engine for beginner and intermediate game programmers
By rdjava in forum Java GamingReplies: 1Last Post: 06-02-2011, 09:29 AM -
1st Game
By linabestprogrammer in forum Java 2DReplies: 1Last Post: 09-05-2010, 10:32 PM -
Implementing "Game Over" in Minesweeper game based on Gridworld framework.
By JFlash in forum New To JavaReplies: 2Last Post: 08-05-2010, 04:49 AM -
game code for any game
By deathnote202 in forum Java GamingReplies: 4Last Post: 06-10-2010, 08:06 AM -
2D strategy game or 2D war game
By led1433 in forum Java 2DReplies: 5Last Post: 02-10-2009, 06:00 AM


2Likes
LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks