Monday, February 27, 2017

PT reflection 1

9:15-9:40: listened to explanation
9:40-9:50: planned
9:50-10:15: started creating pixel system made up of 20x20 canvases.

Wednesday, February 15, 2017

Algorithm reflection

>Give an explanation of each  statement below  and relate it to something they experienced as part of this lesson

  1. 4.2.4D Different correct algorithms for the same problem can have different efficiencies. Both linear search and binary search solve the same problem, but they have different efficiencies.

Some search algorithms are more efficient than others. The program I made should be much faster at searching large sets of data than linear search.

  1. 4.2.4E Sometimes more efficient algorithms are more complex. Binary search is more efficient than linear search, but even though it might be easy to understand at a high level, it is much more challenging to write code for.

More efficient algorithms can be more complex, and harder to code. My algorithm to find a number in a list was much more complex than the linear search.


  1. 4.2.4F Finding an efficient algorithm for a problem can help solve larger instances of the problem. The algorithms we wrote work for any size input.

Algorithms for smaller problems can be used to solve larger ones. In our search algorithm, we designed it to be used for 8 cards, but it could be used for a much larger set.


  1. 4.2.4G Efficiency includes both execution time and memory usage. Execution “time” here means number of operations that need to be performed in the worst case.

More efficient programs take less time and use less memory. My program should take less time and less memory than linear search.


  1. 4.2.4H Linear search can be used when searching for an item in any list; binary search can be used only when the list is sorted. Emphasis should be placed on the fact that binary search only works when the list is sorted. It’s a fact often forgotten.

Binary search can only be used in specific cases whereas linear can be used in almost any case. My algorithm only works with sorted lists because it relies on the fact they are ordered.

Wednesday, February 8, 2017

Refactor questions

  • Why might you want to change or refactor old code?
It keeps your code organized and easier to maintain.
  • Is it necessarily a bad thing to refactor code?
No, its a good thing.
  • What steps can we take to avoid refactoring code too frequently?
Plan ahead and think about what sections of code you will be reusing and make them functions.

Monday, February 6, 2017

Array reflection

  • All the messages a user has sent
array
  • The highest score a user has ever reached on the app
variable
  • A username and password to unlock the app
array or variable

  • In general, when do you think you should you store information in an array, and when should you use a variable?
When you need to store multiple variables or need to store things that need to be ordered. You would want a array for a shopping list, or a list of people in order of the date they signed up for a website.

Friday, February 3, 2017

Coin flip simulation reflection

  1. How long does it take for the number of heads and tails flipped to be equal?
They usually stay pretty equal. 
  1. Longest streak where each roll is greater than or equal to the last
43,083 rolls
  1. Longest streak made of only five (any five) of the six faces on the die (i.e., not equal to the other)
not enough time to do this one.

Wednesday, February 1, 2017

Color Sleuth reflection

When you are done check the following based on what you and your partner did for your Color Sleuth project:
1. Did you develop a program with a purpose? if yes what?
Yes, it's purpose was to entertain people.

2. Did you apply algorithms and integrate math or logical concepts? What did you use?
We used some simple math such as adding/subtracting the score.

3.  Did you apply abstraction ( integrate complexity to manage  math or logical concepts) ? How

We applied abstraction with the update score command. We made it so it is a general function, and adds whatever the input is. Instead of only adding 1 each time, the input is what the score increases by, and by adding negative inputs, we can also subtract things from the score.