Zachary Lopez

Hack Reactor - Week 2 Day 3

Another 10pm night, but it was totally worth it.

We started a new sprint today and my pair, Andy Coenen, and I finished the two day sprint in 2 hours. Awesomeness!
I also can say that I have never eaten this many burritos in such a short period before. With 2 taquerias super close by and the rain, we always seem to end up there for lunch or dinner. I haven’t had 2 in a day, so we will see if that ever comes to pass.

Highlights of the day:

  • N Queens
  • Bitwise operations

N Queens

This is the latest sprint and the problem goes as such: given N number of queens how many ways can you place them on a board of size N by N. Read more here at wiki. This is a great thought exercise and was/is really fun to work through. We have a solution that gets to the answer for N = 15 in 10 mins. The record is N = 26. I don’t know if we can get there (need massive amounts of computing power), but I know that tomorrow we will do our best to optimize the hell out of our code. Which leads me to the next highlight…

Bitwise operations

In Computer Science, there are many different ways to store data. One of the niftiest ways is to store data as straight binary numbers and perform operations on the different bits. An example:

1010 //our data
1111 //we can use this to do an Exclusive Or on this to identify the bits in our data that have zero
0101 //the result

This stuff is super cool, but super hard to process through as you are constantly translating numbers back and forth from binary (base 2) to decimal (base 10).

Last thing, here is a link to one of the projects that I’ve down at Hack Reactor. The various buttons add ‘dancers’ and provide some movement, causing them to lineup and then dance. It’s super cheesy!

comments powered by Disqus