Bulls and Cows
Project Description
Bulls and Cows is a numeric or alphabet version of the popular board game MasterMind.
The aim of the game is to guess a word by the "second" player, wherein the word has been chosen by the "first" player.
Bulls refer to an element in the guessed value, which is not at the correct position, but is there in the value entered by the first player.
A cow is an element in the guessed value which has the same value as well as the correct position in the first player's value.
It was originally a paper-and-pen decoding game played since centuries.
I made this project, when I saw the challenge for a text-based Python game, and I had just started learning Python. It wasn't really heavy in terms of code at all, but did have a wee bit of logic.
Inspiration
The text-based Python Game challenge, the fact that I knew people around me had made it in C++, and that I thought it was a program simple enough for an entry-level newbie programmer like me to try and accomplish. I was proud of the fact that I amde sure I was not influenced by the logic of any body else around me, and avoided seeing any code online - only rules of the game.
Who will enjoy this the most?
Once I complete it, such that I can clear the screen in Python after the first word has been entered, this would be an intense mental game for anybody, and of all ages - whosoever likes to apply their brains in a fun simple game.
The Project
def main():
word=raw_input("Enter the word")
length=len(word)
length2=0
guess=raw_input("Enter your guess")
cow=0
bull=0
for i in range(0,length):
for j in range(0,length):
lett1=word[i]
lett2=guess[j]
if lett1==lett2:
if i==j:
cow=cow+1
if i!=j:
bull=bull+1
print("There are ", cow, "cows and ", bull, "bulls.")
Unpolished code. yet to comment, and add some more functionality.

