For the rest of the 3months the first hour would be spent on solving toy problems. Here is ours today:
Rock Paper Permutation
Given a number of rounds n, return all the possible rock-paper-scissors play possibilities for that number of rounds.
I spent a good amount of thinking, trying to figure what the base case and edge case would be. Visualizing on the whiteboard organized my thoughts but I did not know how to approach this with code.
rps_array = [rock, paper, scissors];Each recursion stack would return an array of length 3, which in turn gets passed into another recursion stack. Basically a tree of threes. I was super happy about this achievement but turns out a good number of people finished the assignment during the first hour. Jeez, there are some smart people here.
result_array = []
recursion function(array){
base-case: if array.length = rounds_num, push this array into result_array
if not, iterate over rps_array to add each one to the array that was passed in, creating 3 new stacks.
pass in each new array back into the recursion function
}
What we did today:
1. Toy Problem
2. Continue pair programming on the subclass dance party sprint
We ended up creating a page that randomly produces a cat_dancer and a banana_dancer. Ours looked mediocre compared to others', me and my partner justified that this is due to our lack of experience with html and css. Whatever makes us feel better, right?
3. Town Hall
1.19.16
No comments:
Post a Comment