Click here to Skip to main content
15,892,059 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Code cant be shown due to an error occurred in the system.
Posted
Updated 10-Jan-16 14:13pm
v5
Comments
Richard MacCutchan 10-Jan-16 10:54am    
Why have you removed all the detail from your question?
Member 12223648 10-Jan-16 11:58am    
it is just my laptop went crazy and it delete it everything but i updated it again, can you take a look and help me fix it.
thank you !
Richard MacCutchan 10-Jan-16 12:11pm    
Fix what? You need to explain exactly what the problem is, and where it occurs.
Member 12223648 10-Jan-16 12:21pm    
it occurs in the beginning of the program after the first printf() statement the computer should give me a guess and i have to give a score for the guess but i dont know what is wrong because it is not giving me a guess it directly asks for a score.
here is an example what the program should do :
pick a four digit number, using digits from 1 to 6.
my guess is : 1122
enter the score for this guess: 11


my guess is : 3344
enter the score for this guess: 1

my guess is; 1155
enter the score for this guess : 0


my guess is: 2236
enter the score for this guess : 21


my guess is: 2246
enter the score for this guess : 22

my guess is : 2426
enter the score for this guess : 40
I got your number in 6 guesses.
Richard MacCutchan 11-Jan-16 2:54am    
Sorry, but you have removed the code from your question, so we cannot help.

1 solution

I think it is time for you to stop guessing what your code is doing. It is time to see your code executing and ensuring that it does what you expect.

The debugger is your friend. It will show you what your code is really doing.
Follow the execution step by step, inspect variables and you will see that there is a point where it stop doing what you expect.
Mastering Debugging in Visual Studio 2010 - A Beginner's Guide[^]
http://docs.oracle.com/javase/7/docs/technotes/tools/windows/jdb.html[^]
https://www.jetbrains.com/idea/help/debugging-your-first-java-application.html[^]

First error: there is not 5556 possibilities, but 6^4=1296 possibilities
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 9-Jan-16 20:58pm    
Exactly, a 5.
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900