Self reflection 5/11

How did you do in the past two weeks?: I gave it my all and so I believe I deserve an A+ since I consistently tried to succeed.

Details: In these past two weeks, I have been working on Guess My number game. I started with the basics and then I began making my game more complex for instance by putting three levels. Nonetheless, while programming this game, I faced many challenges especially syntax and coding difficulties which I sometimes was able to fix them on my own and in other times, I had to go see the Loremaster seeking for help.

Proof: 

import random

def guessnumber ():
x = 1
while True:
print (“Hello there! What is your name?”)
Name = input()
number = random.randint(1, 10)
myGuess = int(input(“Great, “+ Name +”. I chose a number between 1 and 10 so keep writing the numbers you think of.”))
var = 1
while var == 1 :
if myGuess == number:
print (“You are correct, you win!”)
var = 2
elif myGuess < number:
print (“Your guess is lower than the number I chose. Keep trying :(“)
myGuess = int(input(“Try again “+ Name +”. “))
elif myGuess > number:
print (“Your guess is higher than the number I chose. Keep trying :(“)
myGuess = int(input(“Try again “+ Name +”. “))
print (“Now you move up to the next level.”)
number = random.randint(1, 20)
myGuess = int(input(“This time “+ Name +”. I chose a number between 1 and 20 so keep writing the numbers you think of.”))
var = 3
while var == 3 :
if myGuess == number:
print (“You are correct, you win!”)
var = 4
elif myGuess < number:
print (“Your guess is lower than the number I chose. Keep trying :(“)
myGuess = int(input(“Try again “+ Name +”. “))
elif myGuess > number:
print (“Your guess is higher than the number I chose. Keep trying :(“)
myGuess = int(input(“Try again “+ Name +”. “))
print (“You are now at level 3, the highest level.”)
number = random.randint(1, 20)
myGuess = int(input(“This time, “+ Name +”. I chose a number between 1 and 30 so keep writing the numbers you think of.”))
var = 5
while var == 5 :
if myGuess == number:
print (“You are correct, you win! You have reached the end of the game. You can play again if you wish.”)
var = 6
elif myGuess < number:
print (“Your guess is lower than the number I chose. Keep trying :(“)
myGuess = int(input(“Try again “+ Name +”. “))
elif myGuess > number:
print (“Your guess is higher than the number I chose. Keep trying :(“)
myGuess = int(input(“Try again “+ Name +”. “))
guessnumber()

Goal Reflection: My goal was to choose one of the games the Loremaster had proposed to me and code it in order to continue preparing for the semester exam. I successfully achieved this goal as I was able to program the game: Guess my number.

Goal: For next time, I would like to put an option in my game where the user has a specific amount of tries and if he does not guess the number in this amount of times then he looses. Once I figure out how to do this, I will start coding another game to prepare for the finals.

Your year: The most surprising thing I learned about myself this year was that I really like coding games. I only realized this recently since before coding games I was focused on codingbat yet I really like making games!

One thought on “Self reflection 5/11”

Leave a Reply

Your email address will not be published. Required fields are marked *