Saturday, January 26, 2013

And everything ends in a question mark

  I feel rather fortunate for being able to work on the project before its officially assigned. However, this good feeling is often overshadowed by my newfound realization of my understanding of the language. Although the project was introduced as a tool which would help quiz averages, i have found the project to be an assessment tool of sorts. In short, the results aren't pretty. According to my lack of progress within the hour i got to work on the project, it seems that i need to strengthen my understanding of coding syntax, the use of output/input variables (as well as arguments) and etc. The list is quite daunting and aside from looking over previous labs and slides, i dont know how to improve.
    The task as hand is surprising at best and undeniably intimidating. The comprehensive nature of the assignment definitely amps up the difficulty. In the project, students are expected to "to help an angry bird choose its trajectory so it can hit a pig located at a certain distance d and at a certain elevation h from the bird's position." Unfortunately, or fortunately, however you see it, in this first hour alone i've made some discoveries.I don't read very thoroughly. Instead of reading and understanding the hint,i tried to find velocity on my own. sigh. Its times like these that I feel like a genius.

Sunday, January 20, 2013

How to Function

Functions in python are similar to functions in Jeroo. They are defined by the word def followed by the name and then the arguments
ex. def myster(a,b):
Anything included in the function must be written after the definition and indented and when functions are to be used, they need to be called and the call needs to follow the same indention as the definition. Arguments within the call must also be written out
ex myster(a,b)
Regardless of how you define a variable before a function, variables are bound at the call site. In other words, previous variables are forgotten. In the words of the powerpoint "Variables used in functions but defined outside of the function can be changed"

So why you functions or what can you do with functions?
1. they can make code easier
2.they can be used to define local variables (a. a new variable altogether or b. redefining a variable previously defined outside of the function to substitute its value)* these variables are then bound or set within the function
3.define new functions (act as a stepping stone for another function. similar to nesting?)

Lab issues:
So, this week's lab. I gotta say, it wasn't the most straightforward to say the least but i think next time i should open two skeleton documents, get rid of all the notes in one and work on that in order to mitigate any confusion that comes from the text....hopefully the i can focus better on the task. In general, although i feel like i understand functions, i still need to practice more so that defining variables will become more like second nature...maybe tomorrow...maybe : )

Saturday, January 12, 2013

s is for snake?

Nope, no reptiles or creepy crawley snakes to report this week. Just Python, another computer language that looks almost like a natural language.

Recap:
Just as in in Jeroo, code in python consists of functions (ie. print), statements ( print("argument")), loops, and conditionals. Anything enclosed in "" are called strings. Numbers in this language can be categorized as integers or floating and are expressions. As far as variables go and completing tasks, Jeroo is actually very similar to python, at least on the conceptual level. Some differences i really took note of during the lecture is that when assigning variables and so on, the right side is evaluated first and then stored as the variable toward the left of the equal sign. Though i don't know whether or not this is an important deal, it nonetheless was a linguistic nuance that stuck for some odd reason. Furthermore, apparently the tutorial also suggests that one not ought to confuse the equal sign as something which equivocates both sides of the statement. Am i slightly confuzzled. Why yes. Fortunately, i now have python on my computer which means i can practice...because, as the old saying goes, practice makes perfect.

Some basic numerical operations to remember:
OperationSymbolExample
Power (exponentiation)**5 ** 2 == 25
Multiplication*2 * 3 == 6
Division/14 / 3 == 4.666666666666667
Integer Division//14 // 3 == 4
Remainder (modulo)%14 % 3 == 2
Addition+1 + 2 == 3
Subtraction-4 - 3 == 1

chapter 1 of "Non-Programmer's Tutorial for Python 3," down. Next up....break time. : )

Friday, December 7, 2012

I CAUGHT THE JEROO

     Very Thankful. Finished Jeroo Lab 5B in 15 minutes and without help! Even though the beginning of this week was rough, it got progressively better! I owe my progress to my helpful and patient instructor (not trying to kowtow here) for his willingness to coach me through labs and for his tip which i shall dub ULT (short for ultimate). Its not very creative but hey, this isn't English class. Its where students think of tasks in terms of a particular end point and the conditions associated with that end point and then trace back to the point of orientation to work out possible traps and hindrances. I think that's definitely been key to accomplishment today. That and realizing that freaking out about learning does not help one learn better.
     Perhaps this tip isn't applicable to other things like how to study for finals, but its definitely made me more confident about the final exam. I guess I can see why people like Jeroo now because once you get it (code and all), its like a puzzle. I can't say I've mastered the program or the language used in the program but at least I see a light bulb flickering at the end of the tunnel!

Things we explored this week:
-Loops
-If statements
-compound statements
-recursions

Things i would like to improve next week if time permits:
-writing loops that are concise and efficient.
-how to implement recursions and when they work best
-language

Other goals:
-110 on the final : )



Sunday, December 2, 2012

Who said pythons eat Jeroo's?

   That's right, the world is sadly confused. Pythons do not eat Jeroos, they guide them! Well sort of, at least that's what i'm getting so far. So python is one of the codes to use for the program Jeroo. Turns out (thankfully) that Jeroo likes me a lot more than Scratch. This week the class learned about the basics of the program as well as how to program methods or a series of behaviors a jeroo can do that could be thought of as being similar to the repeat scrip in scratch. Basic code is as follows:

to create a jeroo: name=jeroo(row#,column#,number of flowers or cardinal direction)
jeroos can: hop(), pick up flowers, pick(), plant a flower, (plant), toss a flower one spot ahead (toss)
give a flower,give(dir) and turn in a direction, turn(dir)
dir= LEFT, RIGHT,AHEAD,HERE

Methods on the other hand are a series of behaviors a jeroo will perform all branched under one main 'headline'

Writing a method:
Under the methods tab-

def name(self):
       self.hop()
       self.pick(1)
....

Under the regular tab-
jerooname. name()

Tomorrow we're learning about loops. Hopefully this week will be an even more pleasant experience!
     

Sunday, November 18, 2012

I smell freedom in the air!

      In one sense, this week was a smashing success. Out of the two scratch assignments, i completed one with time to spare! The other one, not so much....Not only did i take longer than intended trying to complete (i have yet to finish it) I had to phone a friend on numerous occasions  Do i like scratch any better? Certainly not. But at least there was some improvement this week (no matter how minor).
      However, there are other things to be thankful for. For one, the break's fast coming up....: ) But more than that, I wonder what the course is going to look like after the transition is complete. What will the course look like?  So far, my take on computer programming hasn't been all too great. I definitely don't want the future class to be like an extended scratch assignment. That would be horrific. But I suppose i will just have to wait and see....

Saturday, November 10, 2012

Scratch- the senior version of my most hated nightmare

        I don't remember much from freshmen year but the little I do remember can't be described as my fondest memories. I can never forget the hours I spent in the school dungeon with my glutes glued to a blue plastic chair and my eyes fixed on the background of the program's home screen  Nor can I forget the four hour long brain freezes that occurred afterwards as my body attempted to  recover from excessive neuron transmission. The stuff of nightmares known affectionately by professionals as Solidworks, became my biggest hurdle during the fall semester of freshmen year. Even though it was difficult, I consoled myself through mental pep-talk of the educational kind, convincing myself that every minute spent in mental duress would undoubtedly repay itself at least ten fold in the form of mental acuity. Although I have yet to realize the impact of Solidworks improved brain cognition, I can say that the pep-talk got me through eighteen weeks of torture. Unfortunately, things didn't all go exactly as planned.
        Backtrack three years, I though the end of freshman year would also mean the end of having to do a design or engineering based assignment at least for the rest of high school. Boy was I wrong. I have one word for you: Scratch. But as the old adage goes, when life throws you lemons, make lemonade or die by lemons. Things haven't changed much since freshmen year. Scratch is almost just as bad as Solidworks but isn't it funny that I give myself the same mental pep-talk even three years later? It's been a  long week and the future doesn't seem any less challenging. Regardless, there's not much use in complaining. Now to think of some way to circumvent future bouts of brain deadness like the three-hour-long one i experienced today after finally turning in my quiz lab.....