Good job on the code. This is better then I did the first time I tried this problem. But I do see three big problems:
###1. Stores codes as strings
1. Stores codes as strings
I think that it would be best to use a number/enum for the color, not a string. This will use less memory and simplify comparing later, as well as basically fixing problem 2.
###2. Silently fails on invalid colors
2. Silently fails on invalid colors
As your code stands, a player may put in invalid colors and will not get a warning. So if i guess bleu purple gray orange
, it will say I got nothing, and continue. I think it would be better to tell the user that they are guessing invalid colors. (This is made even worse by the fact that the user is not told what colors are good in the first place.) If you validate as they enter the colors that they entering valid colors, that can fix the problem.
###3. Case sensitive
3. Case sensitive
Red RED Green Black
will fail the comparison the same way as above, because you use strcmp
, not strcmpi
.
Good job on the code. This is better then I did the first time I tried this problem. But I do see three big problems:
###1. Stores codes as strings
I think that it would be best to use a number/enum for the color, not a string. This will use less memory and simplify comparing later, as well as basically fixing problem 2.
###2. Silently fails on invalid colors
As your code stands, a player may put in invalid colors and will not get a warning. So if i guess bleu purple gray orange
, it will say I got nothing, and continue. I think it would be better to tell the user that they are guessing invalid colors. (This is made even worse by the fact that the user is not told what colors are good in the first place.) If you validate as they enter the colors that they entering valid colors, that can fix the problem.
###3. Case sensitive
Red RED Green Black
will fail the comparison the same way as above, because you use strcmp
, not strcmpi
.
Good job on the code. This is better then I did the first time I tried this problem. But I do see three big problems:
1. Stores codes as strings
I think that it would be best to use a number/enum for the color, not a string. This will use less memory and simplify comparing later, as well as basically fixing problem 2.
2. Silently fails on invalid colors
As your code stands, a player may put in invalid colors and will not get a warning. So if i guess bleu purple gray orange
, it will say I got nothing, and continue. I think it would be better to tell the user that they are guessing invalid colors. (This is made even worse by the fact that the user is not told what colors are good in the first place.) If you validate as they enter the colors that they entering valid colors, that can fix the problem.
3. Case sensitive
Red RED Green Black
will fail the comparison the same way as above, because you use strcmp
, not strcmpi
.
Good job on the code. This is better then I did the first time I tried this problem. But I do see three big problems:
###1. Stores codes as strings
I think that it would be best to use a number/enum for the color, not a string. This will use less memory and simplify comparing later, as well as basically fixing problem 2.
###2. Silently fails on invalid colors
As your code stands, a player may put in invalid colors and will not get a warning. So if i guess bleu purple gray orange
, it will say I got nothing, and continue. I think it would be better to tell the user that they are guessing invalid colors. (This is made even worse by the fact that the user is not told what colors are good in the first place.) If you validate as they enter the colors that they entering valid colors, that can fix the problem.
###3. Case sensitive
Red RED Green Black
will fail the comparison the same way as above, because you use strcompstrcmp
, not strcmpi
.
Good job on the code. This is better then I did the first time I tried this problem. But I do see three big problems:
###1. Stores codes as strings
I think that it would be best to use a number/enum for the color, not a string. This will use less memory and simplify comparing later, as well as basically fixing problem 2.
###2. Silently fails on invalid colors
As your code stands, a player may put in invalid colors and will not get a warning. So if i guess bleu purple gray orange
, it will say I got nothing, and continue. I think it would be better to tell the user that they are guessing invalid colors. (This is made even worse by the fact that the user is not told what colors are good in the first place.) If you validate as they enter the colors that they entering valid colors, that can fix the problem.
###3. Case sensitive
Red RED Green Black
will fail the comparison the same way as above, because you use strcomp
, not strcmpi
.
Good job on the code. This is better then I did the first time I tried this problem. But I do see three big problems:
###1. Stores codes as strings
I think that it would be best to use a number/enum for the color, not a string. This will use less memory and simplify comparing later, as well as basically fixing problem 2.
###2. Silently fails on invalid colors
As your code stands, a player may put in invalid colors and will not get a warning. So if i guess bleu purple gray orange
, it will say I got nothing, and continue. I think it would be better to tell the user that they are guessing invalid colors. (This is made even worse by the fact that the user is not told what colors are good in the first place.) If you validate as they enter the colors that they entering valid colors, that can fix the problem.
###3. Case sensitive
Red RED Green Black
will fail the comparison the same way as above, because you use strcmp
, not strcmpi
.
Good job on the code. This is better then I did the first time I tried this problem. But I do see three big problems:
###1. Stores codes as strings
I think that it would be best to use a number/enum for the color, not a string. This will use less memory and simplify comparing later, as well as basically fixing problem 2.
###2. Silently fails on invalid colors
As your code stands, a player may put in invalid colors and will not get a warning. So if i guess bleu purple gray orange
, it will say I got nothing, and continue. I think it would be better to tell the user that they are guessing invalid colors. (This is made even worse by the fact that the user is not told what colors are good in the first place.) If you validate as they enter the colors that they entering valid colors, that can fix the problem.
###3. Case sensitive
Red RED Green Black
will fail the comparison the same way as above, because you use strcomp
, not strcmpi
.