# Problems with my Assignment

• 03-10-2011, 09:10 AM
saifchenko
Problems with my Assignment
Users task is to guess 4 digits generated by my program. Those digits should be unique. My program should give a hint to users based on their guess.
No. of Green – Right digit at the right place
No. of Red – Right digit but at the wrong place

For example :
Number generated is 4589
User guess is 4810
Hint: 1 Green 1 Red

Actually..I really doesnt understand the question..can someone explain it to me?:D
• 03-10-2011, 09:15 AM
sunde887
Have you started anything yet? The goal is for the user to continually guess numbers until they have guessed every number. After each guess you need to compare there choice to the data they are guessing.

If they make a guess that is the right number in the right spot increment green. If they guess a number that is correct, but in the wrong spot, increment red, then display them.

Try storing the targets in a 4 item array. Give it a shot and see how you do, you can also start small with 2 targets digits at a time.