I2P-L7+8

Choose your own adventure game:

Mind map  At the very beginning of our project, we made a mind map in order to showcase the different aspects we were thinking of including. By making these aspects it helped us to visualise the  different things that happened in the game, and some of the genera outlines of the game.

Photo on 14-11-2016 at 4.25 PM

Pseudo Code: This was our pseudo code for the adventure game. We made the pseudo code in order to help us manage the actual coding. Whilst creating the pseudo code, I didn’t think that it would help. It was only when I had started coding did i realise the pseudo code was good reference for the code, especially at times where the coding language is hard to understand.

Aim of the game: To allow the user to continue throughout their story Ask users to input their name Ask users to input their age

Print: You are stuck on a deserted island, known to be filled with mysteries of both the past and present. You wake up on the beach of the island with a chill up your back, and a mysterious feeling that you are being followed. You brush yourself off, and look around the island. Your stomach is growling, but you try to think clearly about your next options. You scratch your options into the sand: Indent: 1. Go to the faraway abandoned hut Indent: 2. Go into the forest Indent: 3. Search for people. Input: Which option do you choose? Which one holds your fate?

Faraway Hut: Print: After long contemplation, and seeing dark clouds hovering over the island, bursting to rain, you decide to go to the abandoned hut and seek shelter. You enter the hut, and notice that it looks empty. Input: Explore the house, or hide in one of the rooms and seek refuge just for the night?

Explore the house Print: You start to explore the rooms of the house, and notice a lot of guns hung up on the walls. After exploring all the rooms, and notice that the hut is empty, you finally start to relax. You sit in one of the lounge chairs in the main part of the hut, but the wind blares a chilly breath of air, and you shiver. You walk over to the window, and try to close it, but you aren’t tall enough. You reach on your tippy-toes and try to close the latch. Whilst doing it, you fall out the window, into a pit of thorns. The thorns dig deep into your skin, and you bleed to death. You die. The End.

Hide in one of the rooms Print: You take refuge in the kitchen and hear a man walk down the steps of the hut. Input: You hide again, or you greet him

  1. If user inputs: You hide again

Then print: You hide, and go to the backyard of his hut. But you walk into a pit of thorns, and bleed to death. You die. The End 2. If the user inputs:  Greet the man Then print: the man greets you with a smile and hugs you- a weird embrace especially since you have never met him. However, during the embrace, you still don’t completely trust him, and feel his pocket. A gun shaped indent. Do you take the gun, or do you run for you life If input is: Take the gun Print: When you take the gun you feel victorious. But as you look around, and see human heads hanging as prizes on the walls, you paralyse. You look around, suddenly forgetting that you just stole a gun from a madman. As you look at the room, you realise that the entire room not only has bloody human heads but also guns. Not just one gun, but many guns. Too many for your liking. But before you know it, the man shoot you five times. You die. The End. If input is: Run for your life. Print: You try to run, but realise this was all a dream. The hut had been latched close since you arrived. The man was watching you since you came on the island. He chuckles softly, and whispers like the madman he is. Tears streaming down your face, you see him take a knife, and say something about adding you to his pretty collection. You stare around the room, and realise all the monuments are dead humans. You have a panic attack, and he kills you when you have fainted. The end, you die.

Print: Go into the Forest:Print: You get lost. You are scared, and darkness is falling. Suddenly, you fall into a pit with poisonous vipers. You die. The End.

Search for People: PrintYou pick up a conch shell on the beach. Suddenly, you hear someone calling for you. Input: Do you go towards the sound (1), or ignore the call (2)? If Input is 2, Print: You try to live alone, but you cannot manage to suffice on your own. You eventually die from starvation. If input is 1, Print: You find a chubby boy with thick spectacles stuck in brambles. You help him out, and discover his name is PIggy. He sees that you have a conch shell, and asks if you know how to blow it. You don’t, and he offers to teach you. Input: Accept (1) or decline (2)? If input is 1, Print: You learn to blow the conch, and when you finally succeed in making a sound, the deep note resonates through the entire island. Over the course of one hour, boys ranging from 6 year olds to 19 year olds stream out of the forest, until eventually an entire choir of boys come out, with a redhead leading the way. All the boys want you to become their leader, but the redhead, Jack, seems to want to be leader too. Input: Do you let Jack share leadership with you (1), or be a dictator (2)? If input is 1, Print: You guys split the leadership and he and his choir helps the group hunt, while you and the others help create a signal fire to get rescued. Your leadership seems harmonious and works really well, living long enough to witness a plane see your signal fire and rescue you. You get rescued and return home safely. Congratulations, you’ve survived! If input is 2, Print: Jack gets jealous and rebels. He and his hunters become more and more uncivilised until they become savages and split from the group. Eventually, out of revenge, Jack and his choir come back and convince your crew that you are a misleading chief. Your group and Jack’s group both set out and rip you apart, until all your remains are washed out into the sea. The End. If input is 2, Print: You and Piggy decide to stay and create a fire, but a wild boar stumbles towards your source of light. Input: Do you fight (1) or flee(2)? If input is 1, Print: You both die trying to kill the wild boar. The End. If is 2, Print: You run away, but a herd of pigs corner you, separating you from Piggy. You get gored to death. The End.

The code, and some of the syntax errors we overcame: 

Some of the syntax errors we faced:

One of the problems that we faced was getting the program to loop on itself. So once a person dies, the game will ask the user to restart or to quit the program. At first we weren’t sure on how we wanted to carry out this program. So after some research and talking to Mr. Lin, we found out that the best way to do this was to create a global function. By creating the global function it allows us to call it up, and break the function at any time to ask the user to restart.

varglobal=0
def function_startagain ():
    startagain= input (print("Do you want to start the game again, press 1 (exit) or 2 (start again)"))
    global varglobal
    if startagain== "2":
        print (funct_game())
    if startagain==1:
        varglobal==1

This shows the function that can be called up by throughout the entire program to be able to quit the program.

Another syntax error that we faced was the combination of the two programs. In order to save time Sonia and I split up the code so that we could be more efficient with time. However, when we got to combining the codes together, we realised that we used two very different approaches to making the code, and therefore there was some things that we had to fix. For example, she used mostly functions and simply called up the function when she needed to use it. I took a different approach to this, and tried to make the program based on mainly if and else statements, combined with a while statement, and incased within a function. When we combined the two codes, we then managed to learn about different ways to solve the same problem, and learned the different perspectives.

Another syntax error that we faced was the different indentations. The indentations were a problem made that were at times hard to fix. Sometimes there were the indent errors due to the  combination of the two codes, but we managed to go through each line and solve the errors that were presented. The only problem with indent errors was that I had to remind myself when I had to indent the breaks.

Another syntax error I faced was one that dealt with the functions, and if and else statements. Since at times there were if and else statements. These if and else statements were hard especially if you had a statement like this inside another one, or a while statement. For example, if we had the user choose between two options, and one of those options led to another question, an if and else statement had to be used within the statement that was already there. This led to many problems with not only indentations but also aspects of the code.

Interpretation of the code: 

varglobal=0
def function_startagain ():
    startagain= input (print("Do you want to start the game again, press 1 (exit) or 2 (start again)"))
    global varglobal
    if startagain== "2":
        print (funct_game())
    if startagain==1:
        varglobal==1
def function_v3a12():
       v3a12 = input(print("""Do you fight (1) or flee(2)? """));
       if v3a12 == "1":
           print("""You both die trying to kill the wild boar. The End. """);
       if v3a12 == "2":
           print("""You run away, but a herd of pigs corner you, separating you from Piggy. You get gored to death. The End. """)
def function_v3a11():
       v3a11 = input(print("""Do you let Jack share leadership with you (1), or be a dictator (2)?"""))
       if v3a11 == "1":
           print("""You guys split the leadership and he and his choir helps the group hunt, while you and the others help create a signal fire to get rescued. Your leadership seems harmonious and works really well, living long enough to witness a plane see your signal fire and rescue you. You get rescued and return home safely. Congratulations, you’ve survived!""")
       if v3a11 == "2":
               print("""Jack gets jealous and rebels. He and his hunters become more and more uncivilised until they become savages and split from the group. Eventually, out of revenge, Jack and his choir come back and convince your crew that you are a misleading chief. Your group and Jack’s group both set out and rip you apart, until all your remains are washed out into the sea. The End.""");
def function_v3a1():
       v3a1 = input(print("""Accept (1) or decline (2)? """))
       if v3a1 == "1":
           print("""You learn to blow the conch, and when you finally succeed in making a sound, the deep note resonates through the entire island. Over the course of one hour, boys ranging from 6 year olds to 19 year olds stream out of the forest, until eventually an entire choir of boys come out, with a redhead leading the way. All the boys want you to become their leader, but the redhead, Jack, seems to want to be leader too. """);
           print(function_v3a11())
       if v3a1 == "2":
           print("""You and Piggy decide to stay and create a fire, but a wild boar stumbles towards your source of light. """);
           print(function_v3a12())

In this first part it was where we defined all the variables before we managed to use them. This is where the pseudo code came in handy, because we knew exactly what needed to be in a variable before we started the game. By already knowing what we wanted to store in the variable, it allowed us to create those variables first, and move into the rest of the code without any problems.


def funct_game(): vBeginning= input("You are stuck on a deserted island, " "known to be filled with mysteries of both " "the past and present. You wake up on the beach " "of the island with a chill up your back, and a mysterious " "feeling that you are being followed. You brush yourself off," " and look around the island. Your stomach is growling, but y" "ou try to think clearly about your next options. You scratch " "your options into the sand:" "\n" " 1. Go to the faraway abandoned hut" "\n" " 2. Go into the forest " "\n" " 3. Search for people.")

The next part of the code was actually starting the game. In order to do this we had to put everything into a function of its own, so that we could call up the function and print it. This means that it sort of makes all the main code into one piece (which would be helpful if this was one selection out of many games)

 

while vBeginning != "1" or "2" or "3":
        if vBeginning == "1":
            print (" After long contemplation, "
                   " seeing dark clouds hovering over "
                   "the island, bursting to rain, you decide to go "
                   "to the abandoned hut and seek shelter. You enter the "
                   "hut, and notice that it looks empty.")
            vhut= input ("Explore the house (1), or hide in one "
                     "of the rooms and seek refuge just for the night? (2) ")
            if vhut== "2":
                print ("You take refuge in the kitchen and hear a man walk down the "
                        "steps of the hut.")
                vhide= input("Do you greet the man(1), or do you continue to hide.(2)")
                if vhide == "2":
                    print ("You hide, and go to the backyard of his hut. But you walk into a pit of thorns, and bleed to death. You die. The End ")
                    print (function_startagain())
                    break
                else:
                    print("The man greets you with a smile and hugs you- a weird embrace especially since you have never met him. However, during the embrace, you still don’t completely trust him, and feel his pocket. A gun shaped indent. ")
                    vgun=input ("Do you take the gun (1), or do you run for your life (2)")
                    if vgun == "2":
                        print (" You try to run, but realise this was all a dream. The hut had been latched close since you arrived. The man was watching you since you came on the island. "
                               "He chuckles softly, and whispers like the madman he is. Tears streaming down your face, you see him take a knife, and say something about adding you to his pretty collection. "
                               "You stare around the room, and realise all the monuments are dead humans. You have a panic attack, and he kills you when you have fainted. The end, you die.")
                        print (function_startagain())
                        break
                    else:
                        print ("When you take the gun you feel victorious. But as you look around, and see human heads hanging as prizes on the walls, you paralyse. "
                               "You look around, suddenly forgetting that you just stole a gun from a madman. As you look at the room, you realise that the entire room not only has bloody "
                               "human heads but also guns. Not just one gun, but many guns. Too many for your liking. But before you know it, the man shoot you five times. You die. The End.")
                        print (function_startagain())
                            break 


This part of the code was the part that I tried to code, but not all of it ( just majority to try to explain) Through this part, I made all the different options into inputs, and for the input answer to be in a true or false ( if this equals to something, then an action will be followed) Once I got the hang of doing this, I completed the code with the same use of different if and else statements. I put the entire code into a while loop. This is to ensure the user will click 1 2 or 3 in the beginning of the game ( and if they don’t then the computer will simply keep asking them for it. As you can see at the end of the code, a break and a print ( function_startagain ()) is used. This is two things. The first is that when you die, the program breaks, and will ask/print the function of restarting the code explained earlier.

 

if vBeginning == "2":
            print("""You get lost. You are scared, and darkness is falling. Suddenly, you fall into a pit with poisonous vipers. You die. The End.""")
            print (function_startagain())
            break
        elif vBeginning == "3":
            print("""You pick up a conch shell on the beach. Suddenly, you hear someone calling for you. """)
            v3a = input("""Do you go towards the sound (1), or ignore the call (2)?""")
            while v3a != "1" or "2":
                if v3a == "1":
                    print("""You find a chubby boy with thick spectacles stuck in brambles. You help him out, and discover his name is PIggy. He sees that you have a conch shell, and asks if you know how to blow it. You don’t, and he offers to teach you. """)
                    print(function_v3a1())
                    break
                elif v3a == "2":
                    print("You try to live alone, but you cannot manage to suffice on your own. You eventually die from starvation. ")
                    print (function_startagain())
                    break

For Sonia’s part of the code, she started  by defining all the functions first, and in the main code simply called up the functions when needed. This seems like less code, and the more efficient way to do this code, but I feel as if it could’ve gotten quite confusing with the functions and calling them up if they were questions that could’ve been simply inputs.


Lists:

fruitList = ["apple", "orange", "banana", "grape"," tomato", "mango"]
print (fruitList [1])
#by printing the string, we can also add in other brackets a number, to print one from the list
#concatenation, adds the number lists together
numberList1 = [1,2,3]
numberList2 = [6,7,8]
numberList3= numberList1 + numberList2
print (numberList3)
#doing the same thing, in fact once you get the variable defined, you don't have to write the list again.
numberList4 = (numberList2 [1])*(numberList2[2])
print ( "\n" ,numberList4,  "\n" )

To start off the lists we began with making the list itself. In order to create a list you have to use the square brackets, and name the variable. Lists are helpful for many things, especially when you want to call different parts of a list ( you then don’t have to keep defining variables, as its all in the list) I also imagine this to be helpful for data collection, and when you have lists of numbers. After making the list itself, we started to add and do different things with our lists, and combinations with the list that we have gotten. So for example, if we wanted to print the list, but we only wanted to print certain parts of the list ( like the first thing in our list, in this case  was a fruit), we could use the position of the word in our list, and the computer would print that after we define this. Furthermore, we also did some refreshing on the indentations. This indenting will definitely come in handy for our choose your own adventure game, to make it look more professional.

#slicing, you can use this:
#Slices a phrase, is the starting point and the last number is the ending point.
#If these are left blank then python assumes that the start position is the beginning of the list, and the end of the list.
print (fruitList[2:5])
print (fruitList [:4])
print (fruitList [5:])

Another fun thing we can do with our lists, is that we can slice the list. This means we can print maybe only a selected amount of the list given, or to only print part of the list. Slicing can also help with the creation of substrings.

fruitList [1] = "Kiwi" #changes the position one fruit to Kiwi Edits the list
print (fruitList)

Furthermore, in the list, we can also choose to change certain parts of the list. This means that throughout the code, you can then change certain parts of your lists at different positions.

olympicList= (["Beijing", 2010],["London", 2012],["Rio", 2016])
print (olympicList)
print (olympicList [1])
print (olympicList [1][0])

Another concept we learned was creating lists within lists. So this means you have multiple lists within the list itself. You can also call up different parts of the list, since there are multiple different parts ( you can choose to call the first part of the second part of the same list)

inventoryList = ["sword","armour","shield","healing potion"]
print ( inventoryList )
inventoryList.sort () #inserts it in the middle #sort, makes it sort
print (inventoryList)

Furthermore, you can also choose to sort different lists. This makes the list into alphabetical order.

#list count - how many times the element appears on the list
#list extend,
 #list.pop #removes an element from the list
v_fruit= fruitList.pop ()
print (fruitList)
print (v_fruit ) #this helps show what  we have removed
v_fruit1= fruitList.pop (0)
print (v_fruit1) #this is to check that it worked
fruitList.reverse ()
print (fruitList)

Another trick we learned today was list count. This counted how many times a certain element appeared on the list. There was also list extend, which helps to combine two lists into one larger list. Furthermore, the list.pop can be used to remove certain aspects of the list. We also reviewed concepts like length, in which helps calculate the length of the element, and the minimum and maximum function. Reflection: Today in class we learnt about how to make lists, and different functions that we can do with the lists, such as how to sort the list, and other helpful tips and tricks. We started to then apply these list functions, as well as inputs into a game, and a brain frame, to make a choose your own adventure game. The brain frame was really helpful in order to sort of map out what we wanted to do with our game, and what direction we were headed for it. After creating the brain frame, we were then able to create our pseudo code with a clearer message in mind. Overall, i really enjoyed the choose your own adventure, as it helped us incorporate some of our concepts, and creativity into a short game that might actually be fun to play.

fruitList = ["apple", "orange", "banana", "grape"," tomato", "mango"]
print (fruitList [1])
#by printing the string, we can also add in other brackets a number, to print one from the list
#concatenation, adds the number lists together
numberList1 = [1,2,3]
numberList2 = [6,7,8]
numberList3= numberList1 + numberList2
print (numberList3)

#doing the same thing, in fact once you get the variable defined, you don't have to write the list again.
numberList4 = (numberList2 [1])*(numberList2[2])
print ( "\n" ,numberList4,  "\n" )


#slicing, you can use this:
#Slices a phrase, is the starting point and the last number is the ending point.
#If these are left blank then python assumes that the start position is the beginning of the list, and the end of the list.
print (fruitList[2:5])
print (fruitList [:4])
print (fruitList [5:])

#this idea of slicing is taking a list, and only commanding part of it to do something
fruitList [1] = "Kiwi" #changes the position one fruit to Kiwi Edits the list
print (fruitList)

olympicList= (["Beijing", 2010],["London", 2012],["Rio", 2016])
print (olympicList)
print (olympicList [1])
print (olympicList [1][0])

#append list methods, grab things
inventoryList = ["sword","armour","shield","healing potion"]
print ( inventoryList )
inventoryList.sort () #inserts it in the middle #sort, makes it sort
print (inventoryList)

#list count - how many times the element appears on the list
#list extend,
 #list.pop #removes an element from the list
v_fruit= fruitList.pop ()
print (fruitList)
print (v_fruit ) #this helps show what  we have removed
v_fruit1= fruitList.pop (0)
print (v_fruit1) #this is to check that it worked
fruitList.reverse ()
print (fruitList)

v_index = fruitList.index ("banana") #position of banana in the List
print (v_index) #prints out wher ethe banana is in the list
print (fruitList)
print (len(fruitList))

print ( "apple" in fruitList)

print (fruitList)
print (min(fruitList))
#minimum of the list
print (fruitList)
print (max(fruitList))

The code for the game:

varglobal=0

def function_startagain ():
    startagain= input (print("Do you want to start the game again, press 1 (exit) or 2 (start again)"))
    global varglobal
    if startagain== "2":
        print (funct_game())
    if startagain==1:
        varglobal==1
def function_v3a12():
       v3a12 = input(print("""Do you fight (1) or flee(2)? """));
       if v3a12 == "1":
           print("""You both die trying to kill the wild boar. The End. """);
       if v3a12 == "2":
           print("""You run away, but a herd of pigs corner you, separating you from Piggy. You get gored to death. The End. """)
def function_v3a11():
       v3a11 = input(print("""Do you let Jack share leadership with you (1), or be a dictator (2)?"""))
       if v3a11 == "1":
           print("""You guys split the leadership and he and his choir helps the group hunt, while you and the others help create a signal fire to get rescued. Your leadership seems harmonious and works really well, living long enough to witness a plane see your signal fire and rescue you. You get rescued and return home safely. Congratulations, you’ve survived!""")
       if v3a11 == "2":
               print("""Jack gets jealous and rebels. He and his hunters become more and more uncivilised until they become savages and split from the group. Eventually, out of revenge, Jack and his choir come back and convince your crew that you are a misleading chief. Your group and Jack’s group both set out and rip you apart, until all your remains are washed out into the sea. The End.""");
def function_v3a1():
       v3a1 = input(print("""Accept (1) or decline (2)? """))
       if v3a1 == "1":
           print("""You learn to blow the conch, and when you finally succeed in making a sound, the deep note resonates through the entire island. Over the course of one hour, boys ranging from 6 year olds to 19 year olds stream out of the forest, until eventually an entire choir of boys come out, with a redhead leading the way. All the boys want you to become their leader, but the redhead, Jack, seems to want to be leader too. """);
           print(function_v3a11())
       if v3a1 == "2":
           print("""You and Piggy decide to stay and create a fire, but a wild boar stumbles towards your source of light. """);
           print(function_v3a12())


def funct_game():
    vBeginning= input("You are stuck on a deserted island, "
                       "known to be filled with mysteries of both "
                       "the past and present. You wake up on the beach "
                       "of the island with a chill up your back, and a mysterious "
                       "feeling that you are being followed. You brush yourself off,"
                       " and look around the island. Your stomach is growling, but y"
                       "ou try to think clearly about your next options. You scratch "
                       "your options into the sand:"
                       "\n" " 1. Go to the faraway abandoned hut"
                       "\n" " 2. Go into the forest "
                       "\n" " 3. Search for people.")
    while vBeginning != "1" or "2" or "3":
        if vBeginning == "1":
            print (" After long contemplation, "
                   " seeing dark clouds hovering over "
                   "the island, bursting to rain, you decide to go "
                   "to the abandoned hut and seek shelter. You enter the "
                   "hut, and notice that it looks empty.")
            vhut= input ("Explore the house (1), or hide in one "
                     "of the rooms and seek refuge just for the night? (2) ")
            if vhut== "2":
                print ("You take refuge in the kitchen and hear a man walk down the "
                        "steps of the hut.")
                vhide= input("Do you greet the man(1), or do you continue to hide.(2)")
                if vhide == "2":
                    print ("You hide, and go to the backyard of his hut. But you walk into a pit of thorns, and bleed to death. You die. The End ")
                    print (function_startagain())
                    break
                else:
                    print("The man greets you with a smile and hugs you- a weird embrace especially since you have never met him. However, during the embrace, you still don’t completely trust him, and feel his pocket. A gun shaped indent. ")
                    vgun=input ("Do you take the gun (1), or do you run for your life (2)")
                    if vgun == "2":
                        print (" You try to run, but realise this was all a dream. The hut had been latched close since you arrived. The man was watching you since you came on the island. "
                               "He chuckles softly, and whispers like the madman he is. Tears streaming down your face, you see him take a knife, and say something about adding you to his pretty collection. "
                               "You stare around the room, and realise all the monuments are dead humans. You have a panic attack, and he kills you when you have fainted. The end, you die.")
                        print (function_startagain())
                        break
                    else:
                        print ("When you take the gun you feel victorious. But as you look around, and see human heads hanging as prizes on the walls, you paralyse. "
                               "You look around, suddenly forgetting that you just stole a gun from a madman. As you look at the room, you realise that the entire room not only has bloody "
                               "human heads but also guns. Not just one gun, but many guns. Too many for your liking. But before you know it, the man shoot you five times. You die. The End.")
                        print (function_startagain())
                        break
            else:
                print ("You start to explore the rooms of the house, "
                           "and notice a lot of guns hung up on the walls. "
                           "After exploring all the rooms, and notice that the "
                           "hut is empty, you finally start to relax. You sit in "
                           "one of the lounge chairs in the main part of the hut, "
                           "but the wind blares a chilly breath of air, and you shiver. "
                           "You walk over to the window, and try to close it, but you aren’t "
                           "tall enough. You reach on your tippy-toes and try to close the "
                           "latch. Whilst doing it, you fall out the window, into a pit of "
                           "thorns. The thorns dig deep into your skin, and you bleed to "
                           "death. You die. The End.")
                print (function_startagain())
                break
        if vBeginning == "2":
            print("""You get lost. You are scared, and darkness is falling. Suddenly, you fall into a pit with poisonous vipers. You die. The End.""")
            print (function_startagain())
            break
        elif vBeginning == "3":
            print("""You pick up a conch shell on the beach. Suddenly, you hear someone calling for you. """)
            v3a = input("""Do you go towards the sound (1), or ignore the call (2)?""")
            while v3a != "1" or "2":
                if v3a == "1":
                    print("""You find a chubby boy with thick spectacles stuck in brambles. You help him out, and discover his name is PIggy. He sees that you have a conch shell, and asks if you know how to blow it. You don’t, and he offers to teach you. """)
                    print(function_v3a1())
                    break
                elif v3a == "2":
                    print("You try to live alone, but you cannot manage to suffice on your own. You eventually die from starvation. ")
                    print (function_startagain())
                    break
            break
print (funct_game())

 

 

 


 

Python Lesson 5- Reflection

The benefits of using Functions:
The benefits of functions are endless, and they can help with many different aspects. The first is that it allows you to repeat lists endlessly. They are required to organise, to reuse code, and to perform single, related action. Functions are used to high degree of repeating. Furthermore, it is also possible to create your own functions.
Defining a function: Functions can be defined with the keyword def, followed by the function name and parentheses. This can later be called up to print, or to do other things, and be repeated as well. However, defining a function only gives it a name, but it’s when you put something into the parentheses does the function have a use. This function then can be used to print. By creating functions, you can use it at any time, at any place, and saves time in terms of you don’t have to keep telling the computer what to do over and over again. Functions come either premade, or you can define your own functions. The pre-made functions can then be used by simply “calling” the function.
def f_sum (int1,int2):
    """this function will add numbers"""
return int1 + int2
#main program
vTotal= f_sum (10,15)
print ("the total is: ", vTotal)

 

The function is useless without being called. But once you call it, you can print it, and define the function as well.

Start of the Chocoltae Machine Challenge.

 The chocolate machine challenge was a really interesting task, and enabled us to put into action some of the things we learnt in previous classes, as well as today. It was interesting to see how we could create code that could actually be used in the real world. Although it is simplistic to many people, it feels accomplishing to know that we are actually at a stage of coding where we can make solutions to real life problems. The chocolate machine challenge was where the machine calculates how much change is received by the person paying. We all started off with making a basic code and adding to it as we continued. I faced problems where we tried to make the code understand that when the given amount of money is less than the needed amount, then the code writes something. We are still working on this part.

For our machine, the next steps is trying to make the code have some sort of function included. Since functions are quite new to everybody, we were all skeptical of using it. I think next time, if we continued to work on the chocolate machine,we could definitely try to incorporate more functions into our machine.

 

Reflection: Overall I really enjoyed today’s class, and think that it was really beneficial. We learned about the uses of functions, and how we can apply it to real situations. It is also interesting to see how all the code we have learnt so far can be used to create simple solutions to problems that may actually occur in real life.

#functions are significant in many ways

# Functions can reduce our program code significantly by putting repeat code into a function
#modules
# Calculations and logical things you have to do--> the better solution is to write a function. You can
# make functions to have infinitely repeats of something.
def f_sum ( int1, int2):
    """This function will add """
#learn how to print on separate lines
# create your own multiple line message here:
print ("""
HI!
""")

def i2P_intro():
    print ("""
HI!
""")

print (i2P_intro())

#what a function does #functions must begin with a letter and not contain spaces
def f_sum (int1,int2):
    """this function will add numbers"""
return int1 + int2
#main program
vTotal= f_sum (10,15)
print ("the total is: ", vTotal)

# prints the total amount of the integers given
#the functions are stored at the top. I needs to store the program first, then make the input underneath, and do something with the variable
#Set the variables first
#Why is there a none at the beginning ?
# this is because the function is not yet used.
#returning values
def f_print_largest (int1, int2):
    """"This function will print the largest integer"""
if int1 > int2:
        print (int1, "is the largest")

    if int1 < int2:
        print ( int2 ," is the largest")

    if int1 == int2 :
        print ( "both numbers are" ,int1, "they are equal")

        #now it is returning, if it is equal the return, the largest of two integers"
def f_larger (int1, int2 ):
        """This function will return the largest of two integers"""
if int1 >= int2:
            return int1

        else:
            return int2

x=12
y=7
z=79
print(f_larger(f_larger(x,y),z))

#int1 = input (" Choose a number ")
int2 = input ( "Choose a number")

f_print_largest(int1,int2)
print ( f_print_largest)

#main program
#enter the price of the chocolate bar in HKD ( 16.90 = $16.90)
price= 16.90
print ("The price of a chocolate bar $16.90")
vcash= float ( input ("How much are you going to pay?"))
vinput = ("please pay again ")
Cashdue= int(vcash) -price
print ( "You change is ", Cashdue,"dollars ")
while vcash != price:
    if vcash > price:
        print ( "You change is ", Cashdue,"dollars ")
    if vcash < price:
        print (" Please pay", price)


In addition: ( this is what we learned in class the next lesson) In this lesson we not only finished our candy machine game, 
but also learned more about functions and their different applications.
# def f_ask_yes_no (question):
#     """"Ask a Yes or No question"""
#     vResponse= None
#     while vResponse not in ("yes", "no"):
#         vResponse= input (question).lower()
#     return vResponse
#
# vQuestion= " Would you like a Mars Bar? "
# vAnswer= f_ask_yes_no(vQuestion )
# if vAnswer =="yes":
#     print ( "here is a Mars Bar, I hope you enjoy it")
# if vAnswer== "no":
#     print ( "No Mars Bar for you ")
#
#
# def menu (question):
# #
# #
# # def print_menu():       ## Your menu design here
# #     print 30 * "-" , "MENU" , 30 * "-"
# #     print "1. Menu Option 1"
# #     print "2. Menu Option 2"
# #     print "3. Menu Option 3"
# #     print "4. Menu Option 4"
# #     print "5. Exit"
# #     print 67 * "-"
# #
# # loop=True
# #
# # while loop:          ## While loop which will keep going until loop = False
# #     print_menu()    ## Displays menu
# #     choice = input("Enter your choice [1-5]: ")
# #
# #     if choice==1:
# #         print "Menu 1 has been selected"
# #         ## You can add your code or functions here
# #     elif choice==2:
# #         print "Menu 2 has been selected"
# #         ## You can add your code or functions here
# #     elif choice==3:
# #         print "Menu 3 has been selected"
# #         ## You can add your code or functions here
# #     elif choice==4:
# #         print "Menu 4 has been selected"
# #         ## You can add your code or functions here
# #     elif choice==5:
# #         print "Menu 5 has been selected"
# #         ## You can add your code or functions here
# #         loop=False # This will make the while loop to end as not value of loop is set to False
# #     else:
# #         # Any integer inputs other than values 1-5 we print an error message
# #         raw_input("Wrong option selection. Enter any key to try again..")
#



vChoice= None
while vChoice != "0":
    print (
        """
        Menu Choice
        0- Exit
        1- Item 1
        2- Item 2
        3- Item 3
        4- Item 4
        """
)

    vChoice =input ("Choice:")
    print ()

    #exit
if vChoice == "0":
        print ("Good-bye")

    #Choice 1

elif vChoice =="1":
        print ( "Choose Item 1 ")

    #Choice 2

elif vChoice =="2":
        print ( "Choose Item 2 ")

        #Choice 3
elif vChoice =="3":
        print ( "Choose Item 3 ")

        #Choice 4
elif vChoice =="4":
        print ( "Choose Item 4 ")

    else:
        print ("Your choice is invalid")

I2P- L3- Guess the Number Game

Screen recording of what we did this lesson.

Today we learnt how to code a game known as the guess the number game. Some of the things we learnt specifically included:

While loops: While loops are repeating sections of code, but it can be quite a slow testing process. Furthermore, indenting claimed to be very important in the while loop; not only to keep things organised, but also was crucial in making the code work properly.

When not equal to: This is shown with an exclamation point and equal sign. By using this it allowed us to create a while variable is not equal to loop.

We also learnt about having the computer generate random integers.

The guess the number game was an interesting game that put together all of our skills together and make a fun short little game. We started by making a pseudo code, the form of code that is made for humans to comprehend. After doing this, we then decided to start by having the code get a random integer between 1-100. By generating the random integer, it allows the game to be played between the computer and the user. The computer after generating the random integer, can be stored as a input variable.

After doing this,  we stored the variable of their name. By doing this we made the game more personal to our user. This applies back to the entire empathy unit we did in the beginning. By doing the simple line of code that allows us to store the name of the user, and using the name throughout, it allows the audience to feel as if the game was made just for them. It allows them to have more of a personal connection to the game.

After making the different variables we started to make a while loop. While loops are good to keep the code running until something is true. In this case we asked the user to input a guess. After giving the guess, the while loop helps make the program responsive to the integer given.

While variable != variable answer:

#Using this != it allows the code to realise that when the integer Is not equal to the random integer generated, then the program can do two of three things, both of which are if statements within the while loop.

Depending on whether the guess is above or below the random integer, the program will tell you whether the integer you guessed is too much or too low.

I actually had quite a lot of challenges with this, as I kept getting syntax errors, due to the fact that my inequality signs were opposite from each other. This meant that when I typed in 0, it would tell me it was more even when the smallest random integer for the program was 0. I worked with some of my classmates to solve this issue, and we found that problem lied in our carelessness.

After we created the if statements for both the lower and higher number, we then created a if statement for when the user guesses the number correctly.  This statement I also had some challenges with, because I had forgotten that in order to make the equal statement you need == for the equal sign. ‘

Overall, today’s lesson was a fun yet interesting learning experience, that helped us to create a game that combined all of the skills we learned so far. I enjoy this sort of lesson and unit, where we learn some small skills, and at the end we get to create a final product that require all of the skills we had learnt so far. I hope that we can continue doing things like this after we learnt more. Furthermore, I was also noticing how we used empathy even to create such a basic code. We used their name to make the code more personal. I noticed how the fundamental of programming is not the code itself, but actually using the code as a tool to create empathy for the audience.

 

 

 

Python Lesson 3, Reflection

Here are two videos on the process that we went through today (they are screen recordings of my computer throughout the coding lesson, so that you can see exactly what I did throughout the lesson)

Reflection:
Today’s lesson was really fun in general, where we were able to learn a lot about pseudo code, and  more about different statements that we can use. We found the importance of flow charts, and did a fun exercise on how to feed a dog using one. After, we started to start the game production of “Guess the number”. This small game combines all the skills that we learned so  far into a fun entertaining game. I’m excited to see the final product later on!
-If, While, For in range statements
Statements are crucial to any part of programming. Here is a short review of each statement we learned in this class.
If- these statements are the one corresponding to the first true condition, or if all conditions are false, then it will go to the final end line.
While- The condition keeps looping as long as the while is true.
 Image result
For- In this specific  example we used the for statement as in if i is in this given range, then we can print this value “i”.
vnumber1= 5
vnumber2= 2
if vnumber1 > vnumber2 :
    print (vnumber1, "is bigger")

vnumber3= 0
while vnumber3 <10:
    print (vnumber3)
    vnumber3 = vnumber3+ 1
for i in range (0,20,2):
    print (i)

vnumber4=  10
while vnumber4 < 6:
    print (vnumber4, "is less than 6")
-The need for planning, using flow charts and pseudo code
Flow charts- Flow charts are used to help map out different loops, and are crucial in programming for many reasons. For the loop for “how to feed a dog” here is the two functions we used.
Decisions- Shown as a diamond- this shows the true or false, in which if it is false then it loops to somewhere, and if it is true, something else happens.
Process- Shown as a rectangle- this shows the process, so simple actions, usually the result of a decision, but can be just simple an action that occurs in the code.
What is a pseudo code?
Pseudo code is used to communicate what the computer is doing, using words and sentences. These occur in # because they are telling the reader what to do, rather than the computer what to do. The pseudo code is a way for coders to communicate what their code does. It is alike to the speech of the code. In other words it is a notation of the simplified programming.
-Include the ‘feed your pet’ algorithm.
We tried to apply both the pseudo and the flow  charts to our own little example. This was using the example on how to feed a dog. Sonia and I first started with making a flow chart, and soon proceeded in creating a pseudo code for it.
WhatsApp Image 2016-10-07 at 11.32.00 AM WhatsApp Image 2016-10-07 at 2.53.44 PM
The beginning of the game making is really interesting so far. After making a pseudo code for this, we managed to have a plan on how to make the code. The parts we have tackled so far is creating a random number generator, in which the computer will generate a number and you will have to guess the number using the guesses that the computer gives you.
Here is the code that we have so far.
import rand.num(1,50)
print("I chose a random number between 1-50, can you guess the number I chose? ")
vnumberguess1= input ("You have five guesses. What is your first guess?")


 Here is the code that we did in this entire class.
#If vnum1 is less than vnum2 then, print vnum 1 is smaller
#pseudo code - comment something, comment, speech, thought process
#while count is less than 6, then  print count is less than 6
# If it says "if" then it is an if statement
vnumber1= 5
vnumber2= 2
if vnumber1 > vnumber2 :
    print (vnumber1, "is bigger")

vnumber3= 0
while vnumber3 <10:
    print (vnumber3)
    vnumber3 = vnumber3+ 1
for i in range (0,20,2):
    print (i)

vnumber4=  10
while vnumber4 < 6:
    print (vnumber4, "is less than 6")
#i=0
#vname1 = input ("What is your name?")
#print (vname1)
#for i in range (vname1[0-12]):
    #print (i) this doesn't work
    #for each letter in "your name" print  each letter
#how to do it?
vname6= input ("What is your name? ") #characters of the name, calling for each
vletter= vname6
print (vletter)
i=0
for letter in vname6:
    print (vname6 [i])
    i=i+1
# vname7= input ("What is your name? ")
#vletter1= vname7
#print (vletter1)
#i=0
#for letter in vname7:
    #print (vname7 [:]) #this means that it prints your name, as many times as there are letters in your name
    #i=i+1
print ("I chose a random number between 1-50, can you guess the number I chose? ")
vnumberguess1= input ("You have five guesses. What is your first guess?")

import rand.num(1,50)
print("I chose a random number between 1-50, can you guess the number I chose? ")
vnumberguess1= input ("You have five guesses. What is your first guess?")

Python Lesson 1, Reflection

Here is a video of my code so far. (It shows how it works so far)
https://www.youtube.com/watch?v=n4qRPs7KvlY&feature=youtu.be
First parts of the coding process
Screen Shot 2016-10-03 at 2.12.08 PM Screen Shot 2016-10-03 at 2.12.19 PM
For the worksheet
Screen Shot 2016-10-03 at 3.05.39 PM
Lesson objectives:
  • Learn how the print function works
  • Defining a variable
  • Using an input function
  • The differences between ‘Integers’ and ‘strings’

Today was the first day of coding, and we started to learn about how to print functions, as well as integers and strings. By doing this, it was a nice introduction to the entire programming unit, and we were able to make a timestable. By making a working timestable (so by asking the user which number timestable they wanted to learn, and by pressing enter having the program write the timestable until 12)

The print function works by writing print, then brackets.

After you write the brackets you could perform two different tasks. One is that you could start off with quotation and ask the program to “speak”. Or you can put a equation eg. 5+3, and ask the program to perform this task.

A variable in programming is a container. You can put the variables into the program as storage containers, to store either words, or numbers.

An input function is basically where they ask the user to input an answer to the prompt. For example, variabled=input (“Where is the kitchen?”) This input would allow us to enable the audience to be able to respond to the prompt.

Integers and strings are different in many ways. A string is for storing words, where integers are a number that the computer recognizes as a number.

I found today’s lesson really helpful, as it was a nice easy way into programming as a whole. By learning more about the strings, and integers, we could apply these to make a simple task. I hope that by learning these simple tasks I can apply them in the future to more complicated tasks.

 

I2P- Summative- Prototype

WhatsApp Image 2016-09-23 at 3.21.23 PMWhatsApp Image 2016-09-23 at 3.21.23 PM (1)

  1. Describe the problem in less than 3 sentences, explaining the what, why, who, how of the problem. Mash together two ideas and create a catchy slogan that sums up your ideas.

The problem is that many are avoiding organization because they find it inconvenient, and they can’t find a planner that suits them . Many people, especially students, are not organizing, and using a planner.
“UR LIFE, UR PLANNER”

Our ad video:

  1. What is the vision and mission of your solution?

Our vision for the planner was to have a planner that suited everyone. Both the design, and the template was made centred around what people wanted. We wanted to make a planner that was easy to use to the point where they would use it. Our end vision was to have a planner that everyone, our entire audience, enjoys the planner that they are using. Our mission for the planner was to make a planner that was simple to use, and customisable to what our audience wanted. We wanted to take the ideas that people wanted, and incorporate it into a planner for them.

  1. Who are the stakeholders? What will be the impact your solution make to them?

The stakeholders for our planner were mostly HKIS students, but it can also be used for any working adults. The impact of our solution would be that they start to more frequently use their planners, instead of using it once in a blue moon.

After talking to the dragon shop ladies, we changed our stakeholders, and targeted a more broad audience, including parents. We made a planner very specific to high school students, and students in general, where a lot of the ladies there could see their kids using the planner, but not them. So we decided to try to make our planner more open to everyone, instead of just one specific audience.

  1. Review the possible solutions, rate and analyze the pros and cons of each of them.

1. Problem #1 – Customisable style

People wanted a planner that would suit their style, instead of being simply a generic planner. It was common that people would have the same planner, and feel like they’re organisation was no longer unique.

Solution #1- To combat this problem we tried to come up with cover designs that oculd be suited for different audiences. So we made one that suited the glamorous, and ones that suited the simplistic person. This gave people the option, and the choice of what type of planner they wanted.

WhatsApp Image 2016-09-26 at 8.50.06 PM (1)

Pros- People would be able to have different styles of planners, and different designs suited to what they want

Cons- In order to make the planner customizable, we would have to individually talk to everyone to see what each person wanted with their cover design.

2. Problem #2- Layout problems

A lot of people wanted different layouts. Some preferred having the weekly planner, so that they could see every week clearly, and some preferred monthly, or even daily planners. These all came with their strengths, and targeted different audiences.

Solution #2- To solve this problem, we made a standardized planner with every month starting with a month on two pages, and the next few were split up into week on two pages.

This allowed us to have both weekly, and a almost daily weekly planner. With the week on two pages it was easy to see everything for each day, but also clearly showed the week plan. Each day divided up into different parts, or sub-boxes. At the top, there is a small square, which indicates the day ( day 1, day 2, etc). Next to it, is the day of the week (monday, tuesday, etc), after this, came a small box with events. This is a place where people can write down after school activities, and other things that occur. The two main sections were split further, with the box on the eft dedicated to quick scrawls of the homework, the and right sub-parted into upcoming, and now. This allowed for prioritization and a organized to-do list.

However, we realised that this may not apply to all the people in our audience. For example, the older adults preferred having each day laid out, with the times of each hour, so that they could plan their events and meetings. This did not apply for students, as usually they didn’t need to plan out their everyday hour to hour.

We decided to solve this problem, we could make insert pages, or special requests. These inserts could be catered to different people and what they needed. So we would have pages like the hour to hour of everyday, which could be used for busy working adults.

Pros- People had more freedom, and could perhaps find a layout that suited them

Cons- It may not suit what everyone wants. So some people may not like making lists, in which the to-do list part would be completely useless.

WhatsApp Image 2016-09-23 at 3.17.19 PM

3. Paper planner vs Electronic planner

People couldn’t decide which one they liked better, as they saw benefits between both of them.Some people even used both, but couldn’t find away to connect the two different methods.

Solution #3- To make a planner that is interchangeable, between both  paper and electronic. Alike to the Evernote notebook we hope to create a planner that could be both online and offline, easily accessible for anyone.

Pros- The concept would be interesting to implement, and it would definitely be convenient to have both accessible, and for it to be interchangeable.

Cons- The planner may be hard to create. You also would have to take pictures and scan it everytime, as well as upload it to the app, which can be considered as a lot of work.

  1. What are the potential challenges you may face?

One of the potential challenges that we might face in the future is making the planner interchangeable. Since we all haven’t had experience with coding, it would be hard for us to make a program that would allow us to make a planner that could be interchangeable.

  1. Tasks to complete the solution and possible prototypes you can make.
There was a lot that went into the process of making this planner. 
The first step was coming up with the layout, so we had to gather ideas from the internet, and what we found that people wanted from our surveys. Next, we started to create a template on the different designs, and chose the best one. 
After we chose on the layout, and the template, we started to make our prototype. 
This included a rough draft of the monthly page, as well as a overview of what a month would look like. 
We then, started to design a logo, and cover page. 
After the prototype was all sketched out, we then decided to ink some of the pages, to see somewhat what the product would look like. We, as a group, debated on whether a printed version of the pages would be better, or whether the hand made one was better. We decided, that it could be the person’s choice on which one they prefer. 
After we finished the prototyping, we were able to start the “selling” points, featuring the ad we made for the planner. This allowed us to see what the marketing of the planner would look like. 

WhatsApp Image 2016-09-26 at 8.51.13 PMWhatsApp Image 2016-09-27 at 5.03.34 PM

  1. Come up with something you can test and prototype. Break it down into small pieces

We had two prototypes. One was a paper planner, and the other was an electronic planner. With the paper planner there are many interesting functions, and we styled it based on what the people wanted. 

One of the problems people had: They liked all of the formats for different various reasons. Some preferred a daily planner, so that they could write in detail what they needed. Some preferred a weekly planner, where they could see that week. And some preferred the monthly, so that they could take a look at the month and know, at a glance, what they needed to do for that month. 

So we decided to come up with a solution for this, to combine all of these in one easy to use design. So in our planner, we included all of these different things, daily, weekly, and monthly in one planner. 

Another one of the problems people faced was not having enough space for their homework, and we saw that a lot of people enjoyed making lists. 

So we decided to include in our planner, both a space that people could write a to do list, events, as well as other homework that they needed to do. 

We also wanted to make the planner customizable, and suited for what you wanted. So we came up with multiple different designs. Here are a few of the cover designs that we made.

In order to see what other people thought of our planner, we then had to bring our prototype around and ask people what they thought about it, and whether it accounted for their needs. In order to do this successfully, we had  to first make a survey with questions that provoked people.
A lot of the results were really interesting, and we saw overall that a lot of people liked  what we produced, but it, of course, could use some improvements. Through asking people, we then can take our planner, and improve it to what people want.
Overall people liked the format of our planner, but thought that the layout and themes could use more effort.

Screen Shot 2016-09-27 at 4.58.53 PM Screen Shot 2016-09-27 at 4.58.59 PM

Here are some of the results:

Screen Shot 2016-09-27 at 5.09.48 PM

Here you can see that a lot of people like the universal planner design, with the runners up being the glamorous and the nature lover design.

Screen Shot 2016-09-27 at 5.09.52 PM

 

We see that from the people we interviewed, a lot of people preferred the paper planner over the electronic one.

 

 

 

 

Screen Shot 2016-09-27 at 5.09.58 PM

 

Most people were willing to pay under 100 dollars for the planner, and a little more after we started to develop the idea.

Through these results, our next steps could include:

1. Designing more planner covers, especially ones that cater towards boys, and other age groups.

2. To perhaps change the inserts so that an option could be hour by hour per day.

3. Start to make the draft two of prototype!

4. Improve more!

Reflection: Overall the prototyping was really fun, and an exciting process! Since we had all of the problems that people had laid out, I was already itching to start to create a solution for it. I loved testing it out, and using my calligraphy to make various different colour designs. It was also really interesting to see what other people thought about it, especially when we interviewed people that had problems with their organisation in the beginning ( their problems they mentioned, helped  create our prototype) I do wish, however, that we had a way to create a drag and  drop type of planner, where people could drag and drop what tools they wanted  in their planner, and print it out so it was really customisable. Even though I do wish we could have done this, I am proud  of the work we managed to accomplish!

Our presentation:

 

1. Summary of your testing results

The testing results were really interesting, and gave us the insight of what people wanted in their planner. One of the most important facts we learned throughout the testing of our prototype was finding out the pros and cons of the prototype we made. For a long time we were only seeing the perspectives of five people. After we went out and surveyed, we were able to find out so many more perspectives.

For example, the one of the cons we saw before the testing:

1. The book looked unprofessional

However, this wasn’t a prominent problem that we saw when we asked people what they thought about the planner. They didn’t bring it up as much because they knew that this was only one of the many prototypes we were going to produce. However, without the survey, we wouldn’t have realised that some people believed that the homework box, and the priority box was redundant and not needed.

Besides finding out the different pros and cons, we also were able to ask people we surveyed before, so that we could see how well they thought we applied the problems they had in our prototype. It was also essential as we managed to see further steps of how we could take this and apply it further.

Through this, we were able to find out that we could take this a little bit further, and actually start to consider making a planner for the next school year. As a team we are discussing about how to improve our designs, and perhaps come up with one for next year.

2. Answer this question..“What does Design Thinking process have to do with programming?”

Design thinking process actually has a lot to do with programming, and could be the fundamental of programming. At first, I didn’t see the connection and found it completely irrelevant, but then after talking to my dad, and researching online, I saw that the design process was essential to programming.

Now, anyone can learn to program, and can learn to code. But the people who make successful products are not people who know how to code the most beautiful lines, but are successful because they use the codes to make beautiful products. Learning to code is another skill that helps you build your ideas. Without thinking of the idea, and going through the design process, the product would have been something that people don’t care about, or no product at all.

You could have all the tools in the world, but with no idea, there is no point. Finding the “point” is finding how to empathise with people, and finding what the people need in their lives. From there, we can take that and create a product people can actually use.

3. Create three:

 “I can..” statements from this process

I can empathise with my audience, and step in their shoes through surveys that are open ended.

I can create and brainstorm prototypes that are fundamentally trying to fix the problems that people had, and adjusting our prototype based on what the people wanted.

I can present my ideas and understand the meaning behind the design thinking process, as well as how it connected back to coding and programming as a whole.

 

 

Intro to programming- 8/17/16

Overview of today- Today in class we started by finding inventions that inspired us to take this course. Then we moved on to creating instructions to help our partner get across to the nearest exit. Then after, we made instructions for tying our shoelaces. By doing this, we learned three different ways to tying our shoelaces and found the most effective way for us.

Steps to explain how Sonia could walk from her desk to the nearest exit. To do this, I devised a set of instructions to help her get from point A to point B. To do this, we had to think like she was a robot, and we had to come up with instructions that were very accurate and precise.

1.Push chair out with feet

2. Stop

3. Stand up

4.  Turn right

5. Step over bag

6. turn right

7. walk forever until stop

8. stop

9. turn left

10. with hands out walk forward

11. Open door with handle

What went well:

Some of the things that went well was that it was easy to follow all of the instructions given. They were easy to follow, and all of them led to the right direction. Something else that went well, was that I took in account many other small steps, that made the process go a lot smoother. For example, in the beginning we had to push the chair out with her feet. If we didn’t do this, then she would be stuck with an uncomfortable manner to stand up. After, we have her step over her bag. Her bag is inanimate object that wasn’t going to move in the time span of Sonia moving (for other objects such as chairs and tables, they moved around due to the fact that they were on moving wheels.)

What didn’t work as well:

One thing we could do to improve is to make our descriptions more detailed. This would include doing things like putting the exact angle, and putting in exact number of steps. By doing this, I learned that we have to be super specific on the instructions that we put forth. This is due to the fact that robots can’t think for themselves, and we have to tell them exactly what to do. However, we are helping robots to learn by themselves.

Photo on 17-8-2016 at 3.02 PM

The next set of instructions is to tie your shoelace. Here I explained the two bunny ear method.

1. take both strings

2. Make a cross section with the strings

3. take the right string and put it over the cross section

4. go under the left string and pull the right string through

5. pull both strings taut

6. take both strings and make a loop with each string

7. cross the right loop over the left loop to create a cross section

8. Go under the left loop and under the intersection pull the right loop through

9. Then pull taut

What was the most successful way of tying your shoelace?

I think that the most efficient way to tie your shoelaces was a method that  Mia taught me. It was the fastest of the three, yet it was the hardest to teach. In my opinion the most successful of tying the shoelace was the most efficient manner. However the two other ones have their own advantages. For example the two bunny ear one was the easiest to teach, and put down in words. Despite being the easiest to teach it was the least efficient of the rest of the solutions.

What could be improved?

Some of the things that could be improved with my steps is actually trying it out on someone, so that I can adjust accordingly. By asking someone to follow the steps I have given I can look at the steps in the perspective of someone who doesn’t know the method. This can help with making it more detailed, and looking out for errors in the steps given.

What did I learn today?

Today I learned how meticulous the steps for the robot has to be, as well as a new way to tie my shoelaces.I learnt that if the steps are not detailed enough then the robot will not be able to follow. I learnt that throughout the following, and making steps for someone to get to the exit, that  we have to make the steps based on each person, and the individuality. Each person has their own “step” and own turn right, functioned towards how their brain takes the information. This was interesting to learn, and compare to whether a robot would have to have individualised programs built specifically for them. I also learnt how sometimes the most efficient method may not be the easiest to explain. This was extremely obvious through the shoelace tying exercise.