Guessing a unique 4 random digits number
As this part of the question has been skipped so far, I'll take it:

Do you think this is too hard?

I think it is. Similarly to your game, in classic Mastermind, the player has to guess a combination of 4 non-unique coloured pegs, and each time is given a mark for the number of correct position and colour combinations.

64 = 1,296 possible combinations

However, with your game (to borrow the nomenclature), there are 10 possible pegs, and as they're unique the combinations are:

10 x 9 x 8 x 7 = 5,040 possible combinations

Which is an increase of 288.8%, furthermore you're only giving the user 5 attempts to guess, as opposed to Mastermind's 6, 8 or 12. The reason Mastermind plays with a minimum of six, is that you get to test every combination, e.g:



However, when you increase the number of possibilities to 10, and reduce the guesses to 5, you can no longer do this, and the chances of never guessing a correct number increase dramatically, e.g.:



Therefore, I think you need to either increase the number of guesses to 10 (at the least), or chose a smaller set of things to guess, like A-F, 1-6, or something GUI based like Mastermind.