GetValidWords check in BullCowGame

Hi there, so I’m on the part where we are getting valid words from the list, I had to use the workaround of using a text file as the word list header file was causing long compile times, anyway I’ve put in all Isograms in place of wordlist in the lecture, code compiles fine but then when I go to play it it isn’t showing the number of valid words.

The code I’m using is:

PrintLine(TEXT(“Valid words is… %c.”), GetValidWords(Isograms).Num());

PrintLine(TEXT(“Valid words -1 is… %c.”), GetValidWords(Isograms).Num() - 1);

so my questions are, am I using the right code? or do I have to type these checks another way as I’m using the Isograms with the text file method?

Thanks in advance.

You have %c for character instead of %i

Wow it was that easy!
so when do we use %c?
%s is for strings if I remember right.

For characters. The most commonly used would be
%f - floating point
%c - character
%s - strings
%i or %d for integers (d stands for decimal)
%p - pointers for printing their address

And a few more
https://en.cppreference.com/w/cpp/io/c/fprintf

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms