The Journey of a First-Time MAGIC Mentor

Juhi Bhatnagar
GirlsGetMAGIC
Published in
5 min readSep 27, 2018

I first heard of the MAGIC (More Active Girls in Computing) program from Pi-Chuan Chang and was excited to be a part of this network of wonderful mentors and mentees from all around the country. I was matched with Kyla B, a tenth grader at Salem High, MA., and we were tasked with completing a project over the summer of 2018. I regularly informed Kim Fujikawa of the status of the project. Kim was the MAGIC coordinator for the summer program with Leap4Ed (the center which Kyla and the other mentees attended).
Kyla had a little experience programming in Scratch but did not have any computer science knowledge. We started out with studying a few important programming concepts: variables, conditionals, and loops. We decided to code in Python because it is a popular and versatile programming language. Our summer project was to program the game of “Spot It!” [http://www.blueorangegames.com/spotit/], an interactive game featuring simple pattern recognition where the player is shown images on two cards and has to find the image which is in common between the two cards.

Introducing the Project
For our implementation of the game, we used three symbols on each card and asked the player to provide an input of which symbol was in common. We used symbols which are present on almost every keyboard, such as #, $, %, etc. The game of “Spot It!” is usually timed but we implemented it so that it allows the player to play the game five times before quitting and telling the player their final the score (the number of guesses they got right).
I wrote a Python template to serve as starter code for Kyla to work with. Since the summer program was only two months, we had to learn while working on the project. I included several comments in my template so that Kyla could look up which data structures I was using. We learned how handy dictionaries are and how to use the ‘random’ function which, when given a range of integers, give us all integers within that range with equal probability so we get a different integer each time. We also learned the importance of documenting our code so that we don’t forget what we had wanted to do! A snippet from the template I had written:

# “Documentation” is an essential aspect of coding. It explains
# your code so that it is easier for you and others to review
# your code. “Single-line comments” such as this one use a
# “# symbol” to indicate that this is a comment.
# “Multi-line comments” use three double quotes to indicate the
# start and end of the “comment block”, as you saw in the
# beginning of this program.
#
# Additionally, each function in Python has a “docstring”
# associated with it, like you will see in the functions below.
# These docstrings immediately follow the function name and explain
# what the function does, its inputs, if any, and its outputs,
# if any.
def check_correct(card1, card2, choice):
"""
Given two cards, represented as “tuples” of 3 symbols:
card1 is (x1,y1,z1)
card2 is (x2,y2,z2)
where x1,x2,y1,y2,z1,z2 are symbols
determine if the selection made by the player, the third variable
choice, is the common symbol between the two cards.
Return True if it is and False if it isn’t.
"""
return False

Constantly Learning
Working on the “Spot It!” project with Kyla was a learning experience for us both. During the first few weeks, we were discussing the ‘main’ function which would run our code and I warned her to be careful with the code and avoid an ‘infinite loop’. Her next question: “What is an infinite loop?” Explaining that was a challenge for me because I was so accustomed to using these technical words in my conversation with other computer scientists and they would just nod their head. I had to think outside my narrow scope of using just technical words to explain what I was saying. I realized yet again why diversity is so important: it challenges us to think from the perspective of another person who thinks differently!
I also encouraged Kyla to develop some soft skills such as maintaining notes for each meeting and thinking of the agenda for our meeting before the meeting itself so that we could have a more structured conversation. We discussed the various ‘functions’ in our code and debated which approach to take in order to solve the problem. We had broken down the problem of coding a game into smaller problems such as creating two cards with random symbols (and one common symbol), checking if the player had selected the right symbol, and outputting everything on the computer screen. A snippet of the create_two_cards function that Kyla wrote:

def create_two_cards():
"""
Return two cards, each with three random symbols represented as a tuple. The two cards should have only one symbol in common.
NOTE: I used the word ‘random’ to indicate that the random module will be used here.
HINT: Python’s random module has a lot of functions to return random integers but I prefer to use random.randint(). Look up what randint does and if it has any inputs.
"""
variable1= random.randint(0,9)
variable2= random.randint(0,9)
if variable1==variable2:
variable2=(variable1+random.randint(0,9))%10
variable3= random.randint(0,9)
if variable1==variable3 or variable2==variable3:
variable3=(variable1+variable2)%10
variable4= random.randint(0,9)
if variable1==variable4:
variable4=(variable1+random.randint(0,9))%10
variable5= random.randint(0,9)
if variable5== variable1 or variable4== variable5:
variable5=(variable1+variable4)%10
card1=(symbols_dictionary[variable1],symbols_dictionary[variable2],symbols_dictionary[variable3])
card2=(symbols_dictionary[variable4],symbols_dictionary[variable5],symbols_dictionary[variable1])
return (card1, card2) # This return statement returns two variables as a tuple

Done Before We Knew It
The two months crept upon us in the blink of an eye! We put finishing touches on our code and we created a presentation for everyone at Leap4Ed to showcase our project! Since I was mentoring Kyla remotely, I was unable to attend the project presentations but I was present to encourage her and help her out with her presentation slides and code demo. Kyla and I practiced a few run-throughs of the presentation before the day of the final presentation.

Demo of our “Spot It!” game

This Isn’t Goodbye
Though the presentation is done and the code has been completed, I am not ready to say goodbye yet. Kyla and I have promised to keep in touch (and share our quirky photographs with one another). I have developed a deep bond with Kyla and have promised that I’ll be just a phone call away.
I was asked to introduce Kyla before her presentation and I wrote a blurb which I would like to share:
This summer, I had the honor of being a MAGIC mentor for Kyla, a smart tenth grader at Salem High. She is inquisitive and eager to learn new concepts to enhance her skills. She is not afraid of experimenting with a new tool and can quickly grasp what she has to work on. Kyla is interested in biology and its sub-sciences, including primatology and veterinary forensic science. She also plays sports and is currently on her school’s volleyball team. She can juggle all these activities very well and ensures that she gives enough time to each. This was my first experience as a MAGIC mentor and I am proud of my mentee, Kyla. I have learned a lot from her during our mentor-mentee meetings and am excited to see what path she chooses.

--

--