Using RandRange() In Bulls and Cows Game

When I implemented the RandRange() function to pull random hidden words from my words list (Lecture 77), I was in for a surprise!.

I compiled and hit play.

The first random word I got was “Bible”
Apparently, “B” and “b” are seen as two different letters, so the computer decided that Bible is an isogram. In my word list that I pulled off the web, Bible was the only word that had a capital letter. Bible is a proper noun since its the name of a book.

I’m thinking that proper nouns are not supposed to be isograms, so I deleted Bible from my random words list.

Has anyone else had this come up?

1 Like

Interesting did you find a way to fix it without deleting the word?

I didn’t spent too much time investigating it, but perhaps one could work with the array, and replace capital letters with lower case ones.

This would allow for more accuracy with proper nouns.

Privacy & Terms