Thursday, July 18, 2013

Coding is fun (Day 4)

Or maybe it sucks. It depends on how you think about it.

Today started with a quick lecture then we worked on our portfolio problems for an hour. That wasn't so bad. Then we had an hour to work on the first of two problems for the day. That problem was nothing but trouble.

We had to write a game that is a boggle board. So you needed to create an array that randomly selected letters of the alphabet. You needed this 16 times in 4 rows of 4. This is to show the "shaking" the covered tray if you were playing in real life. The trouble is that the driver code we were given didn't quite work so after a few hours and 5 TAs we just changed the driver code and figured that was alright. Then we had to make a smarter version of the game that instead of random letters there were 16 sets of data to mimic actual dice. Once that was done the easy step was to adjust the code to make the Q be Qu in the final display and then to make the display pretty. Our pretty one is named "pretty_array" because that's what I said I'd call it. My partner liked how I said "then we win" when talking about completing the program.
Here's the thing. I left at 8 PM and I never even started the second problem of the day.

Granted we didn't work all day because we had a lecture on debugging before lunch and we had an Engineering Empathy session at 4 PM. So basically out of the normal day we only and 2.5 hours to code our projects. The normal day ends at 6pm. Nobody leaves at 6 though. I always leave first when I leave at 8 PM. Some groups completed the second problem where we create a game called Ruby Racer.

I learned a few things today.

  • Our puts statement just printed the object instead of the output I wanted to print. (Happened when we just did "puts board" but if we did "puts board.shake!" then it would work.) The object that it was printing was .self. 
  • The entire class seemed to have trouble with the same part and who everyone got to such different places is some people decided that changing the driver code was OK a lot before other people did. 
  • Using string#ljust will help you out when you want your grid of letters to be pretty but sometimes instead of 4 letters per row there are 5 because a "Q" is never found by itself but is always a "Qu." 
  • I learn more on the days I don't get as much done as I'm supposed to. 
  • Using pry is a good way to debug. You can see what the program is doing at certain points. To install it type gem install pry. I still have yet to try it though. 
  • To make a quick array use %w(word word word) and then you don't have to waste time with the quotes and commas (no need for ['word', 'word', 'word']) 
  • There are 4 parts to the compass of shame: withdrawal, attack others, avoidance, and attack self. 
  • When in conflict there are different ranks (social rank, contextual rank, democratic rank, psychological rank, spiritual rank) Consider the needs of the person you are in conflict with. Slow down and breathe. Honest and transparence. Inquiry - Curiosity and composition. Name your strategies (I want to attack, get power, blame, etc). Enlist your counterpart as your ally. 
  • I learned why someone recommended taking notes. It's because even by the end of the day you forget what you learned in the morning so a few days down the road it will be even worse. 

Some things that were emphasized but I already knew were

  • To get code right before needing to debug: 
  • Use tests. Continuously. 
  • Keep methods small. 
  • Use proper naming of variables. 
  • Have pseudocode. 

To debug

  • look at the error (error line numbers are provided and helpful) 
  • Visualize 
  • Hypothesize and test 
  • modify 
  • test 

I hate pretending. In our EE session we had to pretend to have conflict with our partner acting out a recent conflict they had. Then them acting yours out and arguing with you. Worst thing ever.

I am so tired. Commutes are not fun.
Also I typed this all on the train on the way home and am so tired that I had trouble thinking of what you do in boggle to get the array of letters. Not what you do in Ruby but what you physically do to the real game… shake. If I wasn't so tired, you might get some cooler info on here.

Now this may make no sense because it's coding related or it may make no sense because I'm so tired, I can't tell what's what anymore.

No comments:

Post a Comment