def choose_activity(mentor, codecool_class): ''' Allows to choose event to happen. ''' user_input = input('Please enter a number: ') option = user_input if option == "1": os.system('clear') codecool_class.presentation(mentor) elif option == '2': os.system('clear') chosen_student = choose_student(codecool_class) codecool_class.call_up(mentor, chosen_student) elif option == '3': os.system('clear') print('Students want to drink coffee, but the work is not done yet. \nYou can allow only one student to go kitchen room. Choose one from the list:\n') chosen_student = choose_student(codecool_class) codecool_class.drink_coffee(chosen_student) elif option == '4': os.system('clear') print('Choose a student for private mentoring:\n') chosen_student = choose_student(codecool_class) print('\n') codecool_class.private_mentoring(mentor, chosen_student) elif option == '5': student = choose_student(codecool_class) codecool_class.checkpoint(mentor, student) elif option == '6': os.system('clear') CodecoolClass.student_table(codecool_class.students) elif option == '7': os.system('clear') students_object_list = codecool_class.students full_name = input("Type a student: ") codecool_class.find_student_by_full_name(students_object_list, full_name) elif option == '8': os.system('clear') mentors_object_list = codecool_class.mentors full_name = input("Type a mentor: ") codecool_class.find_mentor_by_full_name(mentors_object_list, full_name) elif option == '0': os.system('clear') sys.exit() elif option == "": print("Type something.") else: raise KeyError("There is no such option.")
def main(): codecool_msc = CodecoolClass.create_local() late_students = MorningRoutine.random_things(codecool_msc.students) JusticeDepartment.random_punishment(late_students) print(codecool_msc.avg_energy()) print(codecool_msc.avg_knowledge()) Learning.morning_dojo(codecool_msc.students) Breaks.random_breaks(codecool_msc.students) coder_pairs = Pair.create_pairs(codecool_msc) Learning.pair_programming(coder_pairs) print(codecool_msc.avg_knowledge()) Breaks.mass_lunchbreak(codecool_msc) NaturalDiasaster.random_disasters(codecool_msc.students) print("The day is over and everyone went home, hopefully with more knowledge than at the start of the day.")
def init_school(): # create school codecool_bp = CodecoolClass.generate_local() input() # create mentors mentor_tomi = codecool_bp.find_mentor_by_full_name("Tamás Tompa") mentor_miki = codecool_bp.find_mentor_by_full_name("Miklós Beöthy") mentor_dani = codecool_bp.find_mentor_by_full_name("Dániel Salamon") mentors = [mentor_miki, mentor_tomi, mentor_dani] # creates list of 3 random students students = [] for i in range(3): students.append(codecool_bp.find_student_by_full_name(codecool_bp.get_random_student())) while students[0].energy_level == students[1].energy_level: # to have students with different energy levels students[1] = codecool_bp.find_student_by_full_name(codecool_bp.get_random_student()) return [students, mentors]
def main(): ''' Main function. ''' codecool_class = CodecoolClass.create_local_school() len_mentors = len(codecool_class.mentors) len_students = len(codecool_class.students) print( "School @ {}, in year {} is created, with {} mentors and {} students.\n".format(codecool_class.location, codecool_class.year, len_mentors, len_students)) chosen_mentor = choose_mentor(codecool_class) while True: story_menu() choose_activity(chosen_mentor, codecool_class) time.sleep(4) os.system('clear')
def main(): codecool_krk = CodecoolClass.generate_local() time.sleep(0.5) codecool_krk.do_gymnastics("Jadwiga Milecka") time.sleep(0.5) codecool_krk.check_overal_energy() time.sleep(0.5) codecool_krk.give_motivational_speech("Jadwiga Milecka", "Kamil Jocz") codecool_krk.find_student_by_full_name("Marek Sawek") codecool_krk.find_student_by_full_name("Mariusz Pudzianowski") codecool_krk.find_mentor_by_full_name("Justyna Głowa") codecool_krk.find_mentor_by_full_name("Beata Szydło") print('Number of Students in Codecool Cracow: {}.'.format( len(codecool_krk.students))) print('Number of Mentors in Codecool Cracow: {}.'.format( len(codecool_krk.mentors)))
def init_school(): # create school codecool_bp = CodecoolClass.generate_local() input() # create mentors mentor_tomi = codecool_bp.find_mentor_by_full_name("Tamás Tompa") mentor_miki = codecool_bp.find_mentor_by_full_name("Miklós Beöthy") mentor_dani = codecool_bp.find_mentor_by_full_name("Dániel Salamon") mentors = [mentor_miki, mentor_tomi, mentor_dani] # creates list of 3 random students students = [] for i in range(3): students.append( codecool_bp.find_student_by_full_name( codecool_bp.get_random_student())) while students[0].energy_level == students[ 1].energy_level: # to have students with different energy levels students[1] = codecool_bp.find_student_by_full_name( codecool_bp.get_random_student()) return [students, mentors]
from random import randint from student import Student from codecool_class import CodecoolClass codecool_bp = CodecoolClass.generate_local() class Code: def __init__(self, difficulty, name=(["Snake Game", "Fakkin' Hard Shit"][randint(0, 1)])): self.name = name self.difficulty = difficulty def get_worked_on(self, student): print("%s's assignement, the '%s' is ready, but he don't know if it's ok." % (student.first_name, self.name)) input() skill = (int(student.knowledge_level) + int(student.energy_level)) print("Based on his attributes, %s's skill is %d. The difficulty of the assignment is %d." % (student.first_name, skill, self.difficulty)) if skill > self.difficulty: print("so, of course, it worked perfectly.") input() print("The mentors's evaluation is:") print("Awesome, %s, the B0SS succesfully completed the %s assignment!" % (student.first_name, self.name)) else: print("So, unfortunately, it couldn't run.") input() print("The mentors's evaluation is:") print("Try again,man! That wasn't even close for %s, to make the %s assignment!" % (student.first_name, self.name)) input() print("Poor %s, he has to do it again..." % student.first_name) input() student.ask_for_help(codecool_bp.mentors[2], self.name)
from codecool_class import CodecoolClass from mentor import Mentor from student import Student from kitchen import Kitchen from salary import Salary from person import Person from assignment import Assignment from meeting import Meeting codecool_msc2016 = CodecoolClass.generate_local() codecool_msc2016.find_student_by_full_name("Bludaba Zsolt") def main(): print( "\n\n" + '\033[1m' + "A csipet-csapat megérkezik a Codecoolba és jó szokásukhoz híven, a konyha felé veszik az irányt." + '\033[0m' + "\n") pakko = Kitchen() pakko.who_is_in_the_kitchen() print( "\n" + pakko.student_in_kitchen + " neki áll vedelni a mogyorós kávét liter számra... Csak mert nem ő vette..." ) pakko.coffee_left(3) pakko.fridge_space_left(60) pakko.pakkos_phrases() print(
from codecool_class import CodecoolClass from education import Education from foosballmatch import FoosballMatch import random School = CodecoolClass.generate_local() print("Welcome to Codecool ", School.location + " " + str(School.year)) # print out the welcome text user_input = input("School.count_students()") School.count_students() user_input = input("School.count_mentors()") School.count_mentors() user_input = input("energy_level = School.check_energy()") energy_level = School.check_energy() user_input = input("School.class_do_gym(energy_level)") School.class_do_gym(energy_level) user_input = input("energy_level = School.check_energy()") energy_level = School.check_energy() user_input = input() print( "\n" + School.mentors[0].first_name + " " + School.mentors[0].last_name + ': "I think that the energy level is optimal."') user_input = input("School.do_project()") School.do_project() user_input = input() print("Continue the day with NOT EXAM.") user_input = input("Education.not_exam(School)") Education.not_exam(School) user_input = input("School.all_class_do_event(2)") School.all_class_do_event(2) # lunch user_input = input("Education.peer_mentoring(School)") Education.peer_mentoring(School)
from codecool_class import CodecoolClass from education import Education from foosballmatch import FoosballMatch import random School = CodecoolClass.generate_local() print("Welcome to Codecool ", School.location + " " + str(School.year)) # print out the welcome text user_input = input("School.count_students()") School.count_students() user_input = input("School.count_mentors()") School.count_mentors() user_input = input("energy_level = School.check_energy()") energy_level = School.check_energy() user_input = input("School.class_do_gym(energy_level)") School.class_do_gym(energy_level) user_input = input("energy_level = School.check_energy()") energy_level = School.check_energy() user_input = input() print("\n" + School.mentors[0].first_name + " " + School.mentors[0].last_name + ': "I think that the energy level is optimal."') user_input = input("School.do_project()") School.do_project() user_input = input() print("Continue the day with NOT EXAM.") user_input = input("Education.not_exam(School)") Education.not_exam(School) user_input = input("School.all_class_do_event(2)") School.all_class_do_event(2) # lunch user_input = input("Education.peer_mentoring(School)") Education.peer_mentoring(School)
def main(): print("Goodmorning Codecoolers! A new day is here!\n") input() cc_budapest = CodecoolClass.generate_local() mentor_immi = cc_budapest.find_mentor_by_full_name("Immánuel Fodor") mentor_laci = cc_budapest.find_mentor_by_full_name("László Molnár") mentor_matyi = cc_budapest.find_mentor_by_full_name("Mátyás Forián Szabó") mentor_zoli = cc_budapest.find_mentor_by_full_name("Zoltán Sallay") input() # attendance is coming print("\nBrace yourself, attendance is coming") input() total_energy = 0 for i in cc_budapest.students: print("Is %s %s here?" % (i.first_name, i.last_name)) print("Yup, and my energy is: {}".format(i.energy_level)) total_energy += int(i.energy_level) average_energy = total_energy / len(cc_budapest.students) print("Great, everyone is here\n") print( "The average energy of the students: %.2f \nLet's do some gymnastics to raise it!" % average_energy) input() print("The Students are doing some gymnastics...") total_energy = 0 for i in cc_budapest.students: i.energy_level += i.energizing.do_gymnastics() total_energy += int(i.energy_level) average_energy = total_energy / len(cc_budapest.students) print("The average energy of the students increased to: %.2f\n" % average_energy) input() print("Well.... that's not much better, let's drink some coffee") total_energy = 0 total_knowledge = 0 for i in cc_budapest.students: i.energy_level += i.energizing.drink_coffee() total_energy += int(i.energy_level) total_knowledge += i.knowledge_level average_energy = total_energy / len(cc_budapest.students) average_knowledge = total_knowledge / len(cc_budapest.students) print("The Student has drunk some coffee.") print("The average energy of the students increased to: %.2f" % average_energy) input() print( "Mentor: Now, please improve the topic you think you can polish your knowledge at" ) study_func(cc_budapest) input() mentor_immi.educate.ring_bell() print("It's 11:45, it's time to eat!\n") input() total_energy = 0 print("Students are enjoying food") for i in cc_budapest.students: i.energy_level += i.behaviour.eating() total_energy += int(i.energy_level) average_energy = total_energy / len(cc_budapest.students) print("The average energy of the students increased to: %.2f" % average_energy) print( "It's 13:00.\nYummie! The lunch was nice, but now we need some motivation\n" ) input() mentor_immi.educate.motivational_speak(cc_budapest.students) input() print("The Mentor is telling a joke: ", sep=" ") laughing_students = mentor_immi.behaviour.tell_joke(cc_budapest.students) for i in laughing_students: i.energy_level += random.randint(1, 5) print("\nBadabummTssss!\nThe joke energized the Students") input() print("Oooo... it seems like guys are starting to behave badly...\n") for i in cc_budapest.students: if i.gender == "male": print(i.first_name + " " + i.last_name + " " + "is", end=' ') i.energy_level += i.studentactions.bad_behaviour() print(i.first_name + "'s energy level raises to: ", i.energy_level) print("\n") input() study_func(cc_budapest) input() mentor_immi.educate.ring_bell() print("It's time to go home")
def mass_lunchbreak(cls, persons): for student in persons.students: cls.lunch_break(student) print("The lunchbreak is done, the class average energy became", CodecoolClass.avg_energy(persons, "notnull"))
from codecool_class import CodecoolClass from mentor import Mentor from student import Student from events import Events import random student = Student("leves", "Laci", "Jocó", 1234, "male", 10, 10) mentor = Mentor("leves", "Dani", "Daniel", 1234, "male", 10, 10) codecool_bp = CodecoolClass("Budapest", 2016, student.create_by_csv(), mentor.create_by_csv()) events = Events("fds", "2re", 3) print("Codecool class generated") print("Venue: " + codecool_bp.location) print("Year: " + str(codecool_bp.year)) input("") # print("\n") # print(codecool_bp.mentors) for i in codecool_bp.mentors: print(i) print("Mentors are ready") input("") # print("\n") for i in codecool_bp.students: print(i) print("Students are ready") input("") # print("\n") print(codecool_bp.students[0] + " drank a coffee") input("") print("Energy of " + codecool_bp.students[0] + " increased from 30 to 55") input("")