This is how i did it

Wrote this before seeing the answer, and made some parts a bit harder just to test myself remembering.

#include <iostream>
#include <string>
using namespace std;

int main()
{
	// Introduce the game
	constexpr int WORD_LENGHT = 5;
	cout << endl;
	cout << "Welcome to Bulls and Cows; a fun word game." << endl;
	cout << "Can you guess the " << WORD_LENGHT << " letter isogram I'm thinking of?\n";
	cout << endl;

	// Get a guess from the player
	string Guess = "";
	cout << "Enter you guess by typing in a " << WORD_LENGHT << " letter word:\n";
	cout << endl;
	cin >> Guess;
	cout << endl;
	
	// Repeat the guess back to them
	cout << "You said: " << Guess; cout << ".\nLet's check if you are right..\n" << endl;
	cout << endl;
	
	return 0;
}

Privacy & Terms