Self reflection 6 April

How did you do this week?: I gave it my all and I think I deserve an A+ because I always tried my best.

Details: In the past two weeks I finished the logic 2 section that consisted of complex loops. I decided to change what I do in class by starting to code games. This is because I wanted to implement the coding skills I learned from coding bat and the variety of problems it offered. Thus, I wanted to start coding games as not only it will prepare me for the final exam but I find it very cool that I am now able to make games. At first, I needed someone to guide me and put me on the right track. Thankfully the Loremaster was there for me and he helped me start and finish my first ever coded game: Rock, Paper, Scissors.

Proof:

import random

def rps ():
p = [“rock”, “paper”, “scissors”]
player = input(“Enter your choice (rock/paper/scissors): “)
computer = random.choice(p)
if player == “rock”:
if computer == “paper”:
print (“Computer played paper. Better luck next time :(“)
if computer == “rock”:
print (“Computer played rock. It’s a tie.”)
if computer == “scissors”:
print (“Computer played scissors, YOU WIN!”)
elif player == “paper”:
if computer == “paper”:
print (“Computer played paper, It’s a tie.”)
if computer == “rock”:
print (“Computer played rock, YOU WIN!”)
if computer == “scissors”:
print (“Computer played scissors, Better luck next time :(“)
elif player == “scissors”:
if computer == “paper”:
print (“Computer played paper, YOU WIN!”)
if computer == “rock”:
print (“Computer played rock, Better luck next time :(“)
if computer == “scissors”:
print (“Computer played scissors, It’s a tie.”)

rps()

Goal Reflection: My goal was to finish Logic 2 and continue working in coding bat. Although I finished Logic 2, yet I decided not to continue in coding bat but to head towards coding games.

Goal: For the next two weeks, I want to continue to code games. Firstly, I would like to make the rock paper scissors game with a loop so that the user can play as long as he wishes to. Moreover, I hope I can get a couple more games done in order to start getting used to coding games correctly and in little time.

Plans: I believe that by having conversations while working that would not affect our working efficiency, it would make our time in Gnimagorp better. It would make me feel that I am not in any normal class where it is very strict and all.

 

One thought on “Self reflection 6 April”

  1. Not bad at all, Fadi. If you want to improve this one, how about some error checking, so you can’t input incorrect data?

    Some other game possibilities that are similar are:
    * guess my number – from a range of possible numbers, try to guess which one the computer picked. Give clues about whether the user’s guess is too high or too low. Keep track of how many guesses it takes them.
    * hangman – might need a small dictionary file to choose words from. Would be fun to try to build an ascii art picture of the poor fellow being hanged, so it displayed an ongoing picture of the game.
    * guess your digits – reverse of guess my number, have the computer try to guess numbers that the player picks. Player writes down 30 digits (0, 1 or 2) at random before playing. The computer asks for 10 numbers at a time. It always guesses first and then checks to see if it guessed correctly. Using a random check, it should be right 10 times out of the 30. Can you come up with an algorithm that improves on that?

Leave a Reply

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