Final Self-Reflection

How did you do this year?

I gave it my all. I learned a lot and I couldn’t be more grateful. Python had me up at night for projects that weren’t obligatory, but for the enjoyment and sense of accomplishment. I hope I don’t lose sight of this as I progress through high school.

What did you learn this year?

I learned a lot about python, for example, loops. I absolutely fell in love with those, as they are great tools for creating functional games. Recursion is also something I am proud to have learned, while it may seem somewhat unnecessary to use when you have loops to make things more efficient, it is still an interesting technique. I never was able to make a game from Scratch before, nor was I ever able to from scratch. Both ways were exciting and fun, and I got to better express my creativity.

As for myself, I learned that I once underestimated myself. I didn’t think I’d enjoy programming as much as I did. This class is the only one I ever worked on for extra credit during a long break (that being this Christmas). Also, I learned that I loved competition, while it wasn’t intensely incorporated in gnimmargorp, I rose to the challenge to ensure I had most gold, and Top 5 for the other categories. I found that I pride in being unique, as I finished as being one of the only people to get through the Tsin quests. All of these things will come in handy, I’m sure of it. I will genuinely miss the class.

FINAL Large GOYO: Number Guesser (Exam Practice)

What are/were your feelings about this project?

I am very proud of my work and final result as it can be played in many different forms and has a lot of features to embrace. The project was starting out to be a practice for the exam that wouldn’t take very long. I feel I went the extra mile, I made 4 gamemodes, implemented statistics, the ability to play multiple times without restarting the code, and made it user-friendly.

How did you plan for this project?  Did you use the plan once you started?

I planned solely to have a 1-100 gamemode, but that was it, I obviously did not keep that same plan as I continued. I used every Python method I could think of.

What did you like or learn during this project? (positive and not)

I learned the difference between integers and floats, which came in handy for my statistics. I also learned how to restart a whole sequence in a program using loops and if-then statements. I liked everything

Will this project change your work or life in any way?  How?

It will definitely change my leaderboard status in gnimmargorp. However, jokes aside, I think it is a sign of how much I’ve improved over this year, and I feel like I’m even more confident to pursue some deeper and more challenging Python projects.

How will you use this project in your life?  Who might you share this with?

I’ve already shared it with friends who try to get the best win streak, which I think is interesting. I’ve made something that has competitive value, something I had always wanted to accomplish. Then again, it really isn’t much more than that, a game.

Link what you did.

import random
#INSTRUCTIONS/INFO
print "Welcome To Number Guesser (by Titus Oldham)"
print "Select your mode based off of your gameplay preference."
print "In Easy, you have 3 tries to guess a number between 1 and 10."
print "In Medium, you have 6 tries to guess a number between 1 and 100."
print "In Hard, you have 10 tries to guess a number between 1 and 1000."
print "In Extreme, you have 15 tries to guess a number between 1 and 1000, but with a twist."
print "By guessing a number, you will be told where in relation you are to the actual one."
print "Good Luck!"
print "\n"

#Statistics Storage
wins = 0
losses = 0
streak = 0

while True:
    #Mode Selection
    a = raw_input("Select: Easy, Medium, Hard, Extreme: ")
    a = a.lower()
    #Easy Mode Gameplay
    if a == "easy": #Conditional
        b = random.randrange(1,11)
        for blank in range(1,4): #Loop
            c = raw_input("Guess Number " + str(blank) + ": ") 
            if int(c) == b:
                print "You Win!"
                wins = wins + 1
                streak = streak + 1 
                break
            elif int(c) > b:
                print "Too High"
                if blank == 3:
                    print "Game Over Number Was " + str(b)
                    losses = losses + 1
                    streak = 0
            elif int(c) < b:
                print "Too Low"
                if blank == 3:
                    print "Game Over, Number Was " + str(b)
                    losses = losses + 1
                    streak = 0
    #Medium Mode Gameplay
    elif a == "medium":
        b = random.randrange(1,101)
        for blank in range(1,7):
            c = raw_input("Guess Number " + str(blank) + ": ")
            if int(c) == b:
                print "You Win!"
                wins = wins + 1
                streak = streak + 1 
                break
            elif int(c) > b:
                print "Too High"
                if blank == 6:
                    print "Game Over Number Was " + str(b)
                    losses = losses + 1
                    streak = 0
            elif int(c) < b:
                print "Too Low"
                if blank == 6:
                    print "Game Over, Number Was " + str(b)
                    losses = losses + 1
                    streak = 0
    #Hard Mode Gameplay
    elif a == "hard":
        b = random.randrange(1,1001)
        for blank in range(1,11):
            c = raw_input("Guess Number " + str(blank) + ": ")
            if int(c) == b:
                print "You Win!"
                wins = wins + 1
                streak = streak + 1 
                break
            elif int(c) > b:
                print "Too High"
                if blank == 10:
                    print "Game Over Number Was " + str(b)
                    losses = losses + 1
                    streak = 0
            elif int(c) < b:
                print "Too Low"
                if blank == 10:
                    print "Game Over, Number Was " + str(b)
                    losses = losses + 1
                    streak = 0
    #Extreme Mode Gameplay
    elif a == "extreme":
        b = random.randrange(1,1001)
        print "Info:" #Info/Instruction pt. 2
        print "Warm means the number is in the 100 digit range."
        print "Hot means the number is in the 50 digit range."
        print "INFERNO means the number is in the 10 digit range."
        for blank in range(1,16):
            c = raw_input("Guess Number " + str(blank) + ": ")
            if int(c) == b:
                print "You Win!"
                wins = wins + 1
                streak = streak + 1 
                break
            elif int(c) in range(b-5,b+5):
                print "INFERNO"
                if blank == 15:
                    print "Game Over Number Was " + str(b)
                    losses = losses + 1
                    streak = 0
            elif int(c) in range(b-25,b+25):
                print "Hot"
                if blank == 15:
                    print "Game Over Number Was " + str(b)
                    losses = losses + 1
                    streak = 0
            elif int(c) in range(b-50,b+50):
                print "Warm"
                if blank == 15:
                    print "Game Over Number Was " + str(b)
                    losses = losses + 1
                    streak = 0
            else:
                print "cold..."
                if blank == 15:
                    print "Game Over Number Was " + str(b)
                    losses = losses + 1
                    streak = 0

    else:
        print "Error: Restart Program"
        break
    print "\n"

    #Statistics Reminder
    print "Session Stats:"
    print "Wins: " + str(wins)
    print "Losses: " + str(losses)
    if losses > 0:
        print "W/L Ratio: " + str(float(wins)/losses)
    if streak >= 2:
        print "You Are On A " + str(streak) + " Game Streak!"
    print "\n"
    
    pa = raw_input("Would You Like To Play Again? y/n: ")
    if pa != "y":
        break
    

Resources (both from stackoverflow, my savior this school year):

Restarting program based upon user input

Difference between integer and float

Other than these, I could accomplish the program based off of experience and memory.

Self Reflection 5/11

I gave it my all.

  • Details: In order to prepare for my exam, I have been reviewing Python on practicepython.com (I found it to be very enjoyable there).
  • Proof: Here are some of the answers to problems I was asked:
    • #The Website Asked Me To Return All Numbers Less Than Or Equal To 5
      
      x = [1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89]
      
      y = []
      
      for number in a:
        if number <= 5:
          y.append(i)
      
      print y

       

      #Website asks me to return whether a word is a palindrome or not
      
      word = input('Your Word: ')
      word2 = word[::-1]
      if word == word2:
          print("Your word is a palindrome")
      else:
          print("Your word is NOT a palindrome")
  • Goal reflection: I will not lie, CodeCombat got boring, and it wouldn’t help me out since all it taught me were made up functions I couldn’t use in the real world. In other words, it was childish, so I decided to do something productive since exam is around the corner.
  • Goal: Continue with studying for exam, might try and make my own game as practice, in case one of the options on the exam interests me.
  • Your year: I honestly underestimated my abilities, I’m glad I took this course, I’ve solved a lot of problems I struggled with when I last tried in 8th grade. I really hope I don’t fall out like I did back then.

Self-Reflection 4/30

How did you do this past two weeks?

I gave it my all. I consistently tried to succeed.

Details: I have continued with the CodeCombat program, learning a lot about their site and the tools I have.

Proof: (The website is not working for me to navigate my progress for proof at the moment, will update later)

Goal reflection: My goal was just to continue at my pace with CodeCombat.

Goal: I will continue at my own pace with CodeCombat unless I become extremely slow within, and then I might jump to a different program.

Large GOYO: CodeCombat #1

It has been 5 classes! YAY! I can now discuss my whereabouts. I have not been in Gnimmargorp, no, I have travelled to a far off floating island known as Kithgard Dungeon, and have made my way through that into another floating island. This one is Backwoods Forest. A lot of CodeCombat is pay-to-play, which is also essentially pay-to-get-good. However, I am not too worried about that, I have so far completed 16 quests, with my hero, Alejandro. I am Level 11 on their rankings. In the dungeon, I learned Python syntax, methods, parameters, strings, loops, and variables while saving villages and fighting ogres. I’ve also been obtaining items that give me functions to use. Kithgard Dungeon took around 3 hours. Backwoods Forest in total will take 2-6 hours, according to the website, and I’ve done around 1/4 of it. There, so far, I’ve learned if/else statements and relational operators. There’s lots for me to explore still, and I will be updating a new GOYO every 5 classes for credit.

https://codecombat.com/user/tytoosgcb
There is the full summary of my work so far. 39 achievements, 16 quests, and a lot of items.

Here is a screenshot of what the coding looks like, along with the animated output of what I inputted:

Pre-GOYO: CodeCombat #1

This is a Large Grow-On-Your-Own for the website “CodeCombat” which turns coding (Python primarily) into a game! I’ve decided to do this in segments, as every 5 classes I’ll claim the GOYO and write a post about what I learned in my time, whether about coding, or the website’s functionality itself. I can also record the in-game progress, as it is shown in more ways than one.

I started this last class, so the next post should arrive next week Thursday, as that is 5 classes, but with the possibility of working on it between classes, you may see it sooner.

Here is a little prelude about what I’ve found out so far:

CodeCombat is a large platform designed for teenagers/young adults to learn programming in a fun, and even competitive environment. There are clans, arenas, customizations that can be explored besides the educational aspect. There are many worlds to explore, and in this journey, the access to functions will increase, and the creativity in your code will be dire to the program.

Self-reflection 3/2

How I Did This Week: I Gave It My All

Details: As I was gone for a lot of the week (only present for 1/3 classes, in fact), I did a medium LOYO. I made a post for it and all, and I’m pretty happy with the educational result.

Proof: I hadn’t saved anything as I did most of my work on the interactive video for the LOYO, but I whipped up something here:

list = [1, 2, 3, 4, 5, 6, 7, 8]

print list
print "\n" + "This is a list"
print "\n"
print list[::-1]
print "\n" + "This is the same list backwards"
print "\n"
print list [::2]
print "\n" + "These are the odd numbers from that list"
list[8:10] = [9, 10, 11]
print "\n"
print list
print "\n" + "This is an updated list, with 3 new exceeding numbers at the end"

Goal Reflection: I have indeed continued with my Python codecademy as promised.

Goal: I will continue to go through with my codecademy promise

Changes: I’ve educated myself a bit more, only as an extension of previous knowledge. But hey, thats something, right?

LOYO: Slice Notation

What did you learn about?

I learned about the extensive usage of slice notation in the Python coding language.

With whom or where did you learn it?

I learned it by myself, but with various online sites, one I found thanks to Avvisi!

Why did you want to learn this?

I realized, after creating my GOYO on the Hunger Games simulator, that slice notation was very useful, and if I could use it to its full extent, I could do quite a lot. Also, just researching it generally is good to do so I have multiple known resources for when I need to look back on it when conducting new projects.

How will you use this project in Gnimmargorp or in your life?

It is very effectively used in Python, which is what I am using in Gnimmargorp, and while I have done most of the quests, I know that some will open up soon that I can use it with, or even go beyond and create my own quests (like GOYOs) and use it in all of its ways.

Resources:

https://www.oreilly.com/learning/how-do-i-use-the-slice-notation-in-python

I found this one on Avvisi, and it is a video that shows notes to the side of it, and is extremely interactive, great for learning.

https://docs.python.org/2.3/whatsnew/section-slices.html

I found this after a quick search, and it is practically an index of all the extensive uses of slice notation. I will definitely look back at this frequently.

Summary of What I Learned

  • I discovered that there are more effective and short ways to slice lists than the way I have been doing it.
  • I learned how to slice in patterns/steps. For example, I can now do it for every even numbered element.
  • I practiced the more basic slicing, so now I know how to do so through memory
  • I learned you can slice with negative values to reveal the list in reverse order
  • I discovered in easier way to append values into lists with slice notation

Self-Reflection — February 14th

Hello, my name is Titus Oldham, and I partake in the computer programming course at Cairo American College.

The quests haven’t been rolling in, and a lot of what I’ve done was confirm the quests from last semester that I had done but not yet clicked “Complete” or “Master” on. I am proud to say I have top gold, while honor is also high up, I haven’t found much use for honor, but I’m keeping a few in my pocket just in case. My 3rd place experience also expresses the following description:

“I gave it my all. I consistently tried to succeed.”

I still seem to be one of the only two Tsin’s in the class, which is interesting as it’s been a while since a new map has opened up and nobody has found (or at least attempted) that road. It does, however, make me feel unique, in a way. I’ve found a pride in my work.

I took it upon myself to update my code for the “Double Or Nothing” quest. It now has visuals for extreme fun and excitement!

import random

dice = [1, 2, 3, 4, 5, 6, 7, 8, 9]
specialdice = [4, 4, 5, 5, 6, 6, 7, 8, 9]

def DON():
    name = raw_input('Who is the customer?: ')
    special = raw_input('Would you like to use the special dice? (True or False): ')
    if special == "True": 
        Rellim = (random.choice(specialdice))
    elif special == "False":
        Rellim = (random.choice(dice))
    else:
        print "Only say True or False"
    Customer = (random.choice(dice))
    R = str(Rellim)
    C = str(Customer)
    print "Rellim's dice roll was: "
    if R == "1":
        print "_____________"
        print "|           |"
        print "|           |"
        print "|     O     |"
        print "|           |"
        print "|           |"
        print "-------------"
    elif R == "2":
        print "_____________"
        print "| O         |"
        print "|           |"
        print "|           |"
        print "|           |"
        print "|         O |"
        print "-------------"
    elif R == "3":
        print "_____________"
        print "| O         |"
        print "|           |"
        print "|     O     |"
        print "|           |"
        print "|         O |"
        print "-------------"
    elif R == "4":
        print "_____________"
        print "| O       O |"
        print "|           |"
        print "|           |"
        print "|           |"
        print "| O       O |"
        print "-------------"
    elif R == "5":
        print "_____________"
        print "| O       O |"
        print "|           |"
        print "|     O     |"
        print "|           |"
        print "| O       O |"
        print "-------------"
    elif R == "6":
        print "_____________"
        print "| O       O |"
        print "|           |"
        print "| O       O |"
        print "|           |"
        print "| O       O |"
        print "-------------"
    elif R == "7":
        print "_____________"
        print "| O       O |"
        print "|           |"
        print "| O   O   O |"
        print "|           |"
        print "| O       O |"
        print "-------------"
    elif R == "8":
        print "_____________"
        print "| O   O   O |"
        print "|           |"
        print "| O       O |"
        print "|           |"
        print "| O   O   O |"
        print "-------------"
    elif R == "9":
        print "_____________"
        print "| O   O   O |"
        print "|           |"
        print "| O   O   O |"
        print "|           |"
        print "| O   O   O |"
        print "-------------"
    print name + "'s dice roll was: "
    if C == "1":
        print "_____________"
        print "|           |"
        print "|           |"
        print "|     O     |"
        print "|           |"
        print "|           |"
        print "-------------"
    elif C == "2":
        print "_____________"
        print "| O         |"
        print "|           |"
        print "|           |"
        print "|           |"
        print "|         O |"
        print "-------------"
    elif C == "3":
        print "_____________"
        print "| O         |"
        print "|           |"
        print "|     O     |"
        print "|           |"
        print "|         O |"
        print "-------------"
    elif C == "4":
        print "_____________"
        print "| O       O |"
        print "|           |"
        print "|           |"
        print "|           |"
        print "| O       O |"
        print "-------------"
    elif C == "5":
        print "_____________"
        print "| O       O |"
        print "|           |"
        print "|     O     |"
        print "|           |"
        print "| O       O |"
        print "-------------"
    elif C == "6":
        print "_____________"
        print "| O       O |"
        print "|           |"
        print "| O       O |"
        print "|           |"
        print "| O       O |"
        print "-------------"
    elif C == "7":
        print "_____________"
        print "| O       O |"
        print "|           |"
        print "| O   O   O |"
        print "|           |"
        print "| O       O |"
        print "-------------"
    elif C == "8":
        print "_____________"
        print "| O   O   O |"
        print "|           |"
        print "| O       O |"
        print "|           |"
        print "| O   O   O |"
        print "-------------"
    elif C == "9":
        print "_____________"
        print "| O   O   O |"
        print "|           |"
        print "| O   O   O |"
        print "|           |"
        print "| O   O   O |"
        print "-------------"
    if Rellim > Customer:
        print "Rellim Wins"
    elif Customer > Rellim:
        print name + " Wins"
    else:
        print "Tie"
DON()

As said last reflection, I will continue to work my hardest on the codecademy course for Python, maybe I will make a grand return to the world of Gnimmargorp, once more opportunities are opened up.

 

Self-Reflection – January 24th

Hello, my name is Titus Oldham, and I partake in a computer programming class.

These past weeks I have done quite a bit, and for my grade, I believe in the following preset description:

“I gave it my all. I consistently tried to succeed.”

——————————————————————————————————————

I updated my morse code translator, so it wouldn’t confuse a couple of characters. I also redesigned how the coding looked, so it was easier to edit later.

#ditdah

from string import maketrans

dict = {
'a' : '01 ',
'b' : '1000 ',
'c' : '1010 ',
'd' : '100 ',
'e' : '0 ',
'f' : '0010 ', 
'g' : '110 ',
'h' : '0000 ',
'i' : '00 ',
'j' : '0111 ',
'k' : '101 ',
'l' : '0100 ',
'm' : '11 ',
'n' : '10 ',
'o' : '111 ',
'p' : '0110 ',
'q' : '0010 ',
'r' : '010 ',
's' : '000 ',
't' : '1 ',
'u' : '001 ',
'v' : '0001 ',
'w' : '011 ',
'x' : '1001 ',
'y' : '1011 ',
'z' : '1100 ',
' ' : '/ '
}



intab = ['01','1000','1010','100','0','0010','110','0000','00','0111','101','0100','11','10','111','0110','0010','010','000','1','001','0001','011','1001','1011','1100']
outtab = "abcdefghijklmnopqrstuvwxyz"

def translate():
    string = raw_input('Message: ')
    if string[0] == "0" or string[0] == "1":
            for letter in string.split():
                if letter in intab:
                    print outtab[intab.index(letter)],
                elif letter == "/":
                    print "   ",
    else:
        if string[0].isalpha():
            for letter in string:
                if letter.isalpha():
                    print dict[letter.lower()],
                elif letter.isspace():
                     print dict[letter.lower()],
        else:
            print letter,


translate()

The semester has been relatively dry for progress and quests, but I am working as hard as I can to continue learning. As of right now, the Python course on codecademy is my main objective. I used to set goals as to when to finish it, but that never worked out, so I will just trying my hardest to complete it.