Alright, there was a second place where code was used -- in the "you lose" message. That's why what prints when you lose doesn't seem to match. Sorry.
Also, I was answering questions and forgot to mention that your white/black peg figure-outer is b0rked. Watch:
Code:
Votre coup (essai no 1): bjbv
Couleurs identiques: 1
Coleurs presentes: 1
Votre coup (essai no 2): bbjv
Couleurs identiques: 0
Coleurs presentes: 4
Votre coup (essai no 3): jbbv
Couleurs identiques: 1
Coleurs presentes: 1
Votre coup (essai no 4): bvbj
Couleurs identiques: 1
Coleurs presentes: 1
Votre coup (essai no 5): brbj
Couleurs identiques: 1
Coleurs presentes: 0
Votre coup (essai no 6): vjrr
Couleurs identiques: 1
Coleurs presentes: 1
Desole, la sequence de couleurs a deviner etait jjvj
When I put the j in the wrong spot, I got credit for all three white pegs, even though I should really only have gotten credit for one. (You need a break after present++ to keep that for loop from finding every single other instance of the same color.) Edit: Oh, and if I had typed vjvj, I would have gotten 2 right + 1 present, instead of 3 right, since the first v would have erased the v in the code, and it wouldn't then match the actual v later.