![]()
#!/usr/bin/python
from termcolor import colored
def question():
score = 0
total = 4
menu = """
1 = Marcelo Tosatti
2 = Bruce Perens
3 = Brian Behlendorf
4 = Jeremy Allison
"""
comment1 = "\nLinus and Alan transferred the maintenance torch of the stable Linux kernel (the kernel considered to be in production) to Marcelo. Since Linus must work closely with this individual, he obviously needed to be part of the selection process. Marcelo is a very capable kernel developer who had demonstrated considerable aptitude at working with the community of kernel developers."
print menu
print """Lets say you want to fire up that little linux laptop. Who can you
yell at if the code is wrong?
""", "\n"
answer = raw_input("What is your answer?: ")
print "\n"
if answer == "1":
print colored("\nCongratulations! That is correct!", "cyan"), comment1, "\n"
score += 1
else:
print colored("\nSorry, that is incorrect!", "red"), comment1, "\n"
print "Score:", score, "\n"
print """
I need a good solid linux distro, who should I talk to?
"""
comment2 = "\nAs the project leader for the Debian project, Bruce authored a \"Social Contract\" to instill a standard code of conduct when working with free software on the project. When the term \"open source\" was coined, this \"Social Contract\" became the Open Source Definition (OSD). Bruce is therefore known as the primary author of the OSD."
print menu
answer = raw_input("What is your answer?: ")
print "\n"
if answer == "2":
print colored("\nCongratulations! That is correct!", "cyan"), comment2, "\n"
score += 1
else:
print colored("\nSorry, that is incorrect", "red"), comment2, "\n"
print "Score:", score, "\n"
print """
If you want your blog on the world wide web, who do you talk to?
"""
comment3 = "\nBrian is the co-founder of the apache Foundation. Since Apache has been the open source killer application, Brian has had an influential role not only within the Apache movement, but also the community at large."
print menu
answer = raw_input("What is your answer?: ")
print "\n"
if answer == "3":
print colored("\nCongratulations! That is correct!", "cyan"), comment3, "\n"
score += 1
else:
print colored("\nSorry that is incorrect!", "red"), comment3, "\n"
print "Score:", score, "\n"
print """
Lets pull some files off of a windows box, who can help us?
"""
comment4 = "\nJeremy is the leader of the SAMBA project. SAMBA is the key interoperability technology used between the UNIX/Linux and Windows worlds. Samba is core technology that is included with most Linux distributions"
print menu
answer = raw_input("What is your answer?: ")
if answer == "4":
print colored("\nCongratulations! That is correct!", "cyan"), comment4, "\n"
score += 1
else:
print colored("\nSorry, that is incorrect!", "red"), comment4, "\n"
print "Score:", score, "\n"
print "\nYour total score is ", score
print "\nYou got a total of %s out of %s right!" % (score, total)
def main():
print colored("\nWelcome to the Linux trivia game. Good Luck!", "blue"), "\n"
question()
if __name__=="__main__":
main()
David Abbott - david at linuxcrazy dot com