#stage.set_background_color("lightsteelblue") # sprite = codesters.Text("text", x, y, "color") #sprite = codesters.Text("Hello in red.", 100, 200, "blueviolet") # sprite = codesters.Rectangle(x, y, width, height, "color") #crazy = codesters.Line(x-start, y-start, x-end, y-end, "color") stage.set_background_color("black") # sprite = codesters.Square(x, y, width, "color") #s = codesters.Square(0, 0, 250, "white") # sprite = codesters.Square(x, y, width, "color") # sprite = codesters.Rectangle(x, y, width, height, "color") # sprite = codesters.Rectangle(x, y, width, height, "color") sprite = codesters.Rectangle(0, 0, 100, 50, "") S1 = codesters.Square(-190,200,90, "cornsilk") S2 = codesters.Square(-190, 100,90, "cornsilk") S3 = codesters.Square(-190, 0,90, "cornsilk") S4 = codesters.Square(-190,-100,90, "cornsilk") S5 = codesters.Square(-190,-200,90, "cornsilk") s1= codesters.Square(190,200,90, "cornsilk") s2= codesters.Square(190, 100, 90, "cornsilk") s3 = codesters.Square(190, -100, 90, "cornsilk") s4 = codesters.Square(190, -200, 90, "cornsilk") s5 = codesters.Square(190, -0, 90, "cornsilk") MR = codesters.Rectangle(-0, -0, 250, 480, "cornsilk") # sprite = codesters.Text("text")Three.wait(2) for Three in range(1,4): # add code here Three = codesters.Text(4-Three,-3,3,"black") Three.set_size(8) Three.wait(.8) Three.hide() S1.hide() S2.hide() S3.hide() S4.hide() S5.hide() s1.hide() s2.hide() s3.hide() s4.hide() s5.hide() MR.hide() stage.set_background_color("lavender") flowers = codesters.Sprite("flowers") flowers.go_to(-185, 133) flowers.set_size(1.6) flowers2 = codesters.Sprite("flowers") flowers2.set_size(1.6) flowers2.go_to(175, -33) Pflower = codesters.Sprite("flower1") Pflower.go_to(140, 133) Pflower.set_size(.8) LBflower = codesters.Sprite("flower2") LBflower.go_to(-170, -27) LBflower.set_size(.8) DBflower = codesters.Sprite("flower3") DBflower.glide_to(-100, -50) Text1 = codesters.Text("K-Team Productions", -0, 250, "Teal") Text1.set_size(2) Text1.glide_to(10, 50) Text1.set_speed(.001) TM= codesters.Text("TM", 196, 40, "Teal") TM.set_size(.4) Text2 = codesters.Text("presents", -0, -200, "Teal") Text2.glide_to(-0, 20) stage.wait(1.8) BrainStorm = codesters.Sprite("fox") BrainStorm.go_to(-250,-156) BrainStorm.glide_to(-0,-148) BrainStorm.say("Hai! I'm BrainStorm ^_^!! I'm gonna tell you how to use this program!") BrainStorm.wait(3.5) BrainStorm.say("First we need to know the names! (No more than 5 sorry -_-)") BrainStorm.wait(3.) BrainStorm.say("Next we need to know the age!") BrainStorm.wait(3.5) BrainStorm.say("After that we need to know how many chores per age group!") BrainStorm.wait(3.5) BrainStorm.say("Then we need to know what chores there are for each age group! ") BrainStorm.wait(3.5) BrainStorm.say("After that, there is a little button on the left side of the canvas with a 'P' on it. Click that to see your results!") BrainStorm.wait(4) BrainStorm.say("Then TA-DA you're done! ^_^") flowers.hide() flowers2.hide() DBflower.hide() LBflower.hide() Pflower.hide() Text1.hide() Text2.hide() TM.hide() BrainStorm.hide() #User Input Names stage.set_background("onlineprofile") prof = codesters.Sprite("profilepicture") prof.go_to(-166,145) prof.set_size(2.4) gru = [3,12] lucy = [13,100] minions = [] fluffy = [] # Strings_we_want checks for the input to be # one of the values - if != it will repeat # until matching input is entered. strings_we_want = ["0", "1", "2", "3", "4","5"] thing1_and_thing2 = ["1", "2"] def my_function(): while True: choice = prof.ask("How many names?") if choice in strings_we_want: break # choice = prof.ask("How many users?") for counter in range(int(choice)): k_team_was_here= prof.ask("New name?") while True: k_team_strikes_again= prof.ask("Age group 1 (3-12) or age group 2 (13 and up) ?") if k_team_strikes_again in thing1_and_thing2: break if k_team_strikes_again == "1": # add your code here minions.append(k_team_was_here) else: # add your code here fluffy.append(k_team_was_here) my_function() #End Of User Input Names # User Input Chores #created by Lydia and Ann def get_chores(arr, age): while True: choice = prof.ask("How many chores for " + age) if choice in strings_we_want: break #turn choice int a number choice_2 = int(choice) #start an empty string str='' for counter in range(choice_2): chore = prof.ask("Name a chore") #add chore to list arr.append(chore) #add chore to string - pretty if str == "": str=chore else: str=str+", "+ chore #print(str) return str #stage.set_background_color("darkcyan") #lydia = codesters.Sprite("person15") #make two empty lists chores_age_1= [] chores_age_2= [] # Checking for numbers again. #strings_we_want = ["1", "2", "3", "4", "5"] # Used to clarify what age group we are requesting # chores for - parameters input below. march = "age group 1 (3-12 years old)?" november = "age group 2 (13 and up)?" chores_age_1_str=get_chores(chores_age_1, march) #lydia .say("Here are the chores for age group 1") #stage.wait(2) #lydia.say(chores_age_1_str) #stage.wait(2) chores_age_2_str=get_chores(chores_age_2, november) #lydia.say("Here are the chores for age group 2") #stage.wait(2) #lydia.say(chores_age_2_str) #stage.wait(2) #lydia.say(" ") # End User Input Chores #Assignment Function # minions & fluffy are from user input names - # minions = age group 1; fluffy = age group 2 # minions = [] # fluffy = [] # pillow & fluffy are from user input chores - # pillow = easy chores; brick = hard chores #chores_age_1= [] #chores_age_2= [] # List holds Final Results assignment_list_1 = [] assignment_list_2 = [] def my_function(input_name,input_chore,final_result): for name in input_name: if len(input_chore) > 0: assignedchore = random.choice(input_chore) print(name + ' obtained "' + assignedchore + '" today!') final_result.append(name + ' obtained "' + assignedchore + '" today!') input_chore.remove(assignedchore) else: print(name + ' obtained "no chores" today!') my_function(minions, chores_age_1, assignment_list_1) my_function(fluffy, chores_age_2, assignment_list_2) #for name in fluffy: # assignedchore = random.choice(brick) # print(name + ' wins "' + assignedchore +'"!') # brick.remove(assignedchore) # End of Chore Assignment Function
Support